Installing

ArchLinux

pacman 명령으로 설치한다.

sudo pacman -Syu hugo

Ubuntu

Ubuntu 공식 패키지로 등록 되어 있으므로 apt 명령으로 설치 한다.

sudo apt install hugo

Snap Package

with Sass/CSCC support

snap install hugo --channel=extedned

whtiout Sass/CSCC support

snap install hugo

Create New Sites

hugo new site sandbox

Add a Theme

themes.gohugo.io에서 테마를 선택한다.

본 예제에서는 ananke 테마를 사용하도록 한다.

cd sandbox
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke

echo 'theme = "ananke"' >> config.toml

테마의 사용법은 해당 테마의 READMD.md 파일을 참고 한다.

Add Posts

hugo new posts/about.md

Start the hugo server

hugo server -D

-D include contet marked as draft

or

hugo server

기본적으로 http://localhost:1313 으로 접속하면 볼수 있다.

기본적으로 Posts 등의 파일이 변경되면 이를 인지 하여 브라우저가 자동으로 Refresh 된다.

Build Static Pages

hugo -D

-D include contet marked as draft

or

hugo

public 디렉터리가 생상되고 배포를 위해서 public 디렉터리를 github page나 Web 서버에 올리면 된다.