본문 바로가기

설정

hugo / github.io 블로그

 

참고 링크 

https://gohugo.io/getting-started/quick-start/

 

Quick Start

Create a Hugo site using the beautiful Ananke theme.

gohugo.io

https://aidanbae.github.io/code/hugo/deploytutorial/

 

Hugo로 github page에 블로그 배포하기

Hugo로 github page에 블로그 배포하기 - 아이단의 블로그

aidanbae.github.io

이거 보고 따라하면 됨.

 


Step 1: Install Hugo 

 

brew install hugo

 

hugo version

 

Step 2: Create a New Site 

hugo new site quickstart (휴고 명령어를 쓸 수 있는 디렉토리. 여기가 git push하는 디렉토리가 아님)

 

Step 3: Add a Theme 

cd quickstart

git init

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

 

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

 

Step 4: Add Some Content 

hugo new posts/my-first-post.md

# draft는 false로 해주고. hugo로 빌드해준다.  quickstart 경로에서.

Step 5: Start the Hugo server 

Now, start the Hugo server with drafts enabled:

 

▶ hugo server -D 

Navigate to your new site at http://localhost:1313/.

 

그냥 hugo server로 하고 draft는 작성시에 false로 하는게편하드라.

 

Step 6: Customize the Theme 

Your new site already looks great, but you will want to tweak it a little before you release it to the public.

baseURL = "https://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "ananke"

Step 7: Build static pages 

It is simple. Just call:

hugo -D

Output will be in ./public/ directory by default (-d/--destination flag to change it, or set publishdir in the config file).

Drafts do not get deployed; once you finish a post, update the header of the post to say draft: false. More info here.

 

 

Step 8: Deploy (https://aidanbae.github.io/code/hugo/deploytutorial/ <- 여기를 참고하세요)

echo 'public/' >> .gitignore

cd public 
git init 
git remote add origin https://github.com/<USER-NAME>/<USER-NAME>.github.io

git push -u origin master

(당연하지만) push는 public 경로에서

 

 

처음 쓸때는 hugo 명령어를 쓸 디렉토리와 / git repository에 푸시해야할 경로가 다르다는 것이 헷갈렸다.