hugo란 무엇인가

Hugo는 가장 인기 있는 오픈 소스 정적 사이트 생성기 중 하나입니다. 사용자들은 Hugo를 사용하여 빠르게 자신만의 웹사이트를 만들 수 있습니다.

구축 단계

hugo 설치

맥에서 hugo를 설치하려면 다음 명령어를 사용할 수 있습니다:

BASH
brew install hugo
Click to expand and view more

install

설치가 완료되면 hugo version을 사용하여 설치 여부를 확인할 수 있습니다:

hugo_version

hugo로 블로그 웹사이트 만들기

Hugo를 설치한 후, hugo를 사용하여 자신의 블로그 웹사이트를 만들 수 있습니다. hugo new site my-blog를 사용하여 my-blog이라는 이름의 웹사이트를 생성합니다.

new-blog-site
이 명령어를 실행하면 현재 디렉토리에 my-blog이라는 디렉토리가 생성됩니다. 그 후 해당 디렉토리로 이동하여 git을 사용하여 초기화합니다.

BASH
cd my-blog
git init
Click to expand and view more

테마 선택

웹사이트를 생성한 후, 테마를 선택해야 합니다. 여기에는 선택할 수 있는 많은 테마가 있습니다: hugo themes 여기서 저는 hugo-theme-even 테마를 선택했습니다. 이때 이 테마를 submodule로 themes/even에 추가해야 합니다.

BASH
git submodule add https://github.com/olOwOlo/hugo-theme-even.git themes/even
Click to expand and view more

pick-theme
그 후 themes/even/exampleSite/config.toml을 현재 디렉토리로 복사하고 hugo.toml을 덮어씌웁니다.

BASH
cp themes/even/exampleSite/config.toml hugo.toml
Click to expand and view more

블로그 작성

테마 설정이 완료되면 자신의 블로그를 만들 수 있습니다. hugo new content content/post/my-first-post.md를 사용하여 블로그를 작성할 수 있습니다. 이 명령어를 실행하면 content/post/ 아래에 새로운 md 파일이 생성됨을 볼 수 있습니다.

my-first-blog

hugo 실행

모든 설정이 완료된 후, hugo server를 사용하여 hugo 서버를 시작할 수 있습니다.

링크를 클릭하면 블로그 웹사이트 주소에 접속할 수 있습니다.
이때 이전에 생성한 블로그가 표시되지 않는 이유는 처음 생성한 블로그가 draft 상태이고, hugo server 모드에서는 draft의 블로그가 표시되지 않기 때문입니다. 표시하려면 hugo server -D를 사용해야 합니다.

이로써 블로그 웹사이트 구축이 완료되었습니다.

로컬 블로그를 GitHub에 저장하기

PLAINTEXT
git remote add origin https://github.com/yourusername/myblog.git
git push
Click to expand and view more

이렇게 하면 블로그를 GitHub에 저장할 수 있습니다.

참고 링크

  1. https://gohugo.io/getting-started/quick-start/
  2. https://github.com/olOwOlo/hugo-theme-even
  3. https://medium.com/@magstherdev/hugo-in-10-minutes-2dc4ac70ee11

Copyright Notice

Author: heyjude

Link: https://heyjude.blog/ko/posts/how-to-create-blog-with-hugo/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Comments

검색 시작

검색어를 입력하세요

↑↓
ESC
⌘K 단축키