Hugo ๋ธ๋ก๊ทธ ๊ธ ์ฐ๊ธฐ (create content) & publish the site
https://dovnaldisn.tistory.com/153
Hugo ๋ธ๋ก๊ทธ ๋ง๋ค๊ธฐ
https://gohugo.io/getting-started/quick-start/ Quick startLearn to create a Hugo site in minutes.gohugo.io ํ์๋ ์ ๋งํฌ๋ฅผ ํตํด Hugo ํ์ด์ง๋ฅผ ๋ง๋ค์ด๋ดค๋ค. ์ค๋น๋ฌผ 1. git ๋ค์ด๋ก๋ ๋งํฌ https://git-scm.com/downloads Git
dovnaldisn.tistory.com
์ฌ๊ธฐ์ ์ด์ด์ ๋ฐํํ๋ค.
์ด๋ฒ ๊ธ์ ๊ธ์ ๋ง๋๋ ๋ฐฉ๋ฒ๊ณผ publishํ๋ ๋ฐฉ๋ฒ์ ํฌ์คํ ํ๋ ค๊ณ ํ๋ค
๋ธ๋ก๊ทธ ๊ธ ์ฐ๊ธฐ (create content)
hugo new content content/posts/my-first-post.md
hugo new
hugo new ๋ช ๋ น์ด๋ ์ ์ฝํ ์ธ ํ์ผ์ ์์ฑํ๋ ๋ฐ ์ฌ์ฉ๋๋ค.
๋ค์ ์ค๋ ๊ฒฝ๋ก๋ Hugo์ ์ฝํ ์ธ ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ์ ๋ฐ๋ผ ์๋ก์ด ํ์ผ์ด ์์ฑ๋ ์์น๋ฅผ ์ง์ ํ๋ค.
content
์ด ๋ถ๋ถ์ ์์ฑํ ํ์ผ์ด ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ ์์น๋ฅผ ๋ํ๋ธ๋ค.
Hugo์ ๊ธฐ๋ณธ ์ฝํ ์ธ ๋๋ ํ ๋ฆฌ๋ content ํด๋์ด๋ฏ๋ก, ์ด ๋ช ๋ น์ด๋ ๊ธฐ๋ณธ ์ฝํ ์ธ ๋๋ ํ ๋ฆฌ ๋ด์์ ์๋ก์ด ํ์ผ์ ์์ฑํ๊ฒ ๋๋ค.
content/posts
- ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก: content/posts๋ content ๋๋ ํ ๋ฆฌ ๋ด์ posts ํ์ ๋๋ ํ ๋ฆฌ๋ฅผ ๋ํ๋ธ๋ค.
๋ธ๋ก๊ทธ ํฌ์คํธ๋ฅผ ์์ฑํ ๋ ์ฃผ๋ก ์ฌ์ฉ๋๋ฉฐ, ์ฌ๊ธฐ์์ ์ ๋ธ๋ก๊ทธ ํฌ์คํธ๋ฅผ ๊ด๋ฆฌํ๊ฒ ๋๋ค.
- ์๋ฏธ: posts๋ ๋ธ๋ก๊ทธ ๊ธ์ ์ ์ฅํ๋ ์ผ๋ฐ์ ์ธ ๋๋ ํ ๋ฆฌ ์ด๋ฆ์ด๋ค.
์ด ํ์ ํด๋ ๋ด์ ์ ํ์ผ์ ์์ฑํ๋ฉด ๋ธ๋ก๊ทธ ๊ธ๋ก ์ธ์๋๋ค.
my-first-post.md
my-first-post.md๋ ์๋ก ์์ฑ๋ Markdown ํ์ผ์ ์ด๋ฆ์ด๋ค.
์ ๋ช ๋ น์ด๋ฅผ ์คํํ๋ฉด hugo ํ๋ก์ ํธ ๋ด์ /content/posts ํด๋ ์์ md ํ์ผ์ด ์์ฑ๋ ๊ฑธ ๋ณผ ์ ์๋ค.
+++
title = 'My First Post'
date = 2024-08-14T14:56:57+09:00
draft = true
+++
## Introduction
This is **bold** text, and this is *emphasized* text.
Visit the [Hugo](https://gohugo.io) website!
์์ ๊ฐ์ ํ์์ผ๋ก .md ๊ฐ ๋ง๋ค์ด์ก์ ๊ฒ์ด๋ค.
hugo server --buildDrafts
# ํน์
hugo server -D
# ๋ ์ค์ ๊ฐ์ ์๋ฏธ์ด๋ค.
์๋ฒ๋ฅผ ์ฌ๊ฐ๋ํด๋ณด์
(--buildDrafts ์ -D ๋ ๋ค ๋ชจ๋ ๊ฐ๋ฐ ์๋ฒ๋ฅผ ์คํํ๋ฉด์ ์ด์ ์ฝํ ์ธ ๋ฅผ ํฌํจํ์ฌ ๋น๋ํ๊ณ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ์ ๊ณตํ๋ค.)
์๊น ์์ฑํ post๋ฅผ ๋ณผ ์ ์๋ค.
์ด๋ ๊ฒ ๊ฐ๋จํ๊ฒ post๋ฅผ ์์ฑํ ์ ์๊ณ , ๋ด์ฉ์ markdown์์ ์์ ํ๋ฉด ๋๋ค.
Publish The Site
์ด ๋จ๊ณ์์๋ ์ฌ์ดํธ๋ฅผ publishํ์ง๋ง, deployํ์ง๋ ์๋๋ค.
์ฌ์ดํธ๋ฅผ publishํ๋ฉด, Hugo๋ ํ๋ก์ ํธ์ ๋ฃจํธ ๋๋ ํ ๋ฆฌ์ ์๋ public ๋๋ ํ ๋ฆฌ์ ์ ์ฒด ์ ์ ์ฌ์ดํธ๋ฅผ ์์ฑํ๋ค.
์ฌ๊ธฐ์ publish์ deploy์ ์ฐจ์ด
- publish: Hugo์์ "์ฌ์ดํธ๋ฅผ publish"ํ๋ค๋ ๊ฒ์ Hugo๊ฐ ํ๋ก์ ํธ์ ๋ชจ๋ ์ฝํ ์ธ ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ ์ ์ฌ์ดํธ ํ์ผ๋ค์ ์์ฑํ์ฌ, ํ๋ก์ ํธ์ public ๋๋ ํ ๋ฆฌ์ ์ ์ฅํ๋ ๊ณผ์ ์ด๋ค. ์ด๋ Hugo๋ HTML, CSS, JavaScript, ์ด๋ฏธ์ง ๋ฑ ์น์ฌ์ดํธ๋ฅผ ๊ตฌ์ฑํ๋ ๋ชจ๋ ํ์ผ์ ๋ง๋ค๊ณ ์ ๋ฆฌํ๋ค. ์ด ์์ ์ ๋ก์ปฌ ํ๊ฒฝ์์ ์ด๋ฃจ์ด์ง๋ฉฐ, ์ค์ ์น์๋ฒ์ ์ ๋ก๋๋์ง ์์ ์ํ์ด๋ค.
- deploy: ๋ฐฐํฌ๋ ์์์ ์์ฑ๋ public ํด๋์ ํ์ผ๋ค์ ์น์๋ฒ๋ ํธ์คํ ์๋น์ค์ ์ ๋ก๋ํ์ฌ ์ค์ ๋ก ์ฌ๋๋ค์ด ์น์ฌ์ดํธ์ ์ ์ํ ์ ์๋๋ก ๋ง๋๋ ๊ณผ์ ์ด๋ค. ์ฆ, ์ฌ์ดํธ๋ฅผ ์ธํฐ๋ท์ ๊ณต๊ฐํ๋ ์์ ์ด๋ค.
hugo
- ์ถ๋ ฅ๋ ํต๊ณ:
- Pages: ์ด 10๊ฐ์ ํ์ด์ง๊ฐ ์ฒ๋ฆฌ๋์์ต๋๋ค.
- Static files: 1๊ฐ์ ์ ์ ํ์ผ(์ด๋ฏธ์ง๋ ์คํ์ผ์ํธ ๋ฑ)์ด ์ฒ๋ฆฌ๋์์ต๋๋ค.
- Aliases: 1๊ฐ์ ๋ณ์นญ(๋ฆฌ๋ค์ด๋ ํธ ์ค์ )์ด ์ฒ๋ฆฌ๋์์ต๋๋ค.
- Cleaned: ์๋ฌด ๊ฒ๋ ์ ๋ฆฌ๋์ง ์์์ต๋๋ค.
์ด๋ ๊ฒ hugo๋ฅผ ํตํ์ฌ publish ํ ์ ์๊ณ , ์๋กญ๊ฒ publish ํ๊ณ ์ถ๋ค๋ฉด, project๋ด์์ public์ด๋ผ๋ ํด๋๋ฅผ ์ญ์ ํ ํ ๋ค์ hugo ๋ช ๋ น์ด๋ฅผ ์คํํ๋ฉด ๋๋ค.
๋ค์์๋ ํด๊ณ ํ ๋ง๋ฅผ ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ํด์ ํฌ์คํ ํ๊ฒ ๋ค