Hugo

  • 정적 사이트 생성기 (SSG, Static Site Generator)
    • 정적 웹페이지를 쉽게 생성해주는 프레임워크(or 라이브러리)
    • 빌드를 통해 HTML 결과물을 생성
    • GitHub Pages 와 Netlify 로 손쉽게 웹사이트 운영이 가능
  • JAM 스택
    • Javascript, Api, Markup Stack
    • 위의 기술로 웹사이트를 구성하는 방법
  • SSG 종류
    • Jekyll (GitHub Pages 기본 제공)
    • Hexo (Go 기반)
    • Gatsby (React, Node.js 기반)
    • VuePress (Vue 기반)
    • 등등

설치

  • 먼저 hugo 패키지를 설치
$ brew install hugo ... 🍺 /opt/homebrew/Cellar/hugo/0.83.1: 44 files, 65.0MB $ hugo version hugo v0.83.1+extended darwin/arm64 BuildDate=unknown
  • 프로젝트 생성
$ hugo new site quickstart Congratulations! Your new Hugo site is created in /Users/xxx/dev/hugo/test. Just a few more steps and you're ready to go: 1. Download a theme into the same-named folder. Choose a theme from or create your own with the "hugo new theme <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>". 3. Start the built-in live server via "hugo server". Visit https://gohugo.io/ for quickstart guide and full documentation. 

실행

  • 로컬 서버 실행
    • 기본 localhost:131 3
$ hugo server -D
  • 템플릿을 선택하고 ./public 디렉토리에 결과 HTML 생성
$ hugo -T
  • ./public 을 GitHub 에 올려서 Pages 로 확인 가능
    •