Quickstart Hugo Academic Theme

본 포스팅에서는 hugo-academic 테마를 이용하여 Github Page에 Publishing 하는 방법을 간단하게 다룹니다.

$ hugo new site my-site
$ cd my-site
$ git init
$ git submodule add https://github.com/gcushen/hugo-academic.git themes/academic
$ cp -r themes/academic/exampleSite/. .

$ # Test http://localhost:1313
$ hugo server -D # -b "192.168.0.2" --bind="0.0.0.0"

$ # github에 commit하기
$ git remote add origin https://github.com/j3rrry/my-site.git
$ git add .
$ git commit -m 'first commit'
$ git push origin master
  • baseURL은 url을 넣어주면 된다. (Academic v4.0.0은 url 작성 시 맨 뒤에 /를 추가하도록 하고 있다.)
  • theme를 지정해주지 않으면 Hugo 기본 테마가 적용된다. themes/ 디렉토리 안에 있는 테마 이름과 동일하게 지정해주면 된다.

Github Page에서는 세 가지 방법으로 Publishing 할 수 있습니다.1 그 중에서 첫 번째 방법인 master branch로 Hugo site를 Publishing 해보겠습니다.

  • j3rrry.github.io를 이름으로 갖는 레포지토리 만들어 놓기

먼저 빌드를 합니다.

$ hugo
$ ls public/

public/ 디렉토리 안에 빌드된 사이트가 만들어진다. 빌드된 것을 Publishing 하는 것이다.

$ cd public/
$ git init
$ git remote add origin https://github.com/j3rrry/j3rrry.github.io.git
$ git add .
$ git commit -m 'first commit'
$ git push origin master

앞으로도 계속 새로운 포스팅을 하거나 테마를 수정한 다음에는 빌드한 후 j3rrry.github.io 레포지토리에 commit을 하면 https://j3rrry.github.io에 적용될 것이다.

Avatar
j3rrry
정보보호 컨설턴트

4년제 졸업했으며 취업연계 교육을 받았으며 CTF 참가하는 것을 좋아합니다.

Related

comments powered by Disqus