Skip to content

Instantly share code, notes, and snippets.

@koji
Last active April 4, 2018 05:09
Show Gist options
  • Save koji/c330e2549a649bd10205f2bb7283f9b0 to your computer and use it in GitHub Desktop.
Save koji/c330e2549a649bd10205f2bb7283f9b0 to your computer and use it in GitHub Desktop.
Hugo basic commands

Hugo Basic Commands

install hugo
$ brew install hugo

check the version of hugo
$ hugo version
Hugo Static Site Generator v0.38 darwin/amd64 BuildDate:

create a blog post
$ hugo new post/post001.md

create a page
$ hugo new test.md

run server
$ hugo server
$ hugo server -D (for draft)

create a public folder(build)
$ hugo

makefile

build:
  rm -rf public
  hugo
  
deploy: build
aws s3 sync public/ s3://bucket url --acl public-read --delete
aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id "id" --paths '/*'

.travis.yml for S3

language: go
install:
- go get -v github.com/gohugoio/hugo
- pip install --user awscli
script:
- hugo version
- make deploy
branches:
  only:
  - master
@koji
Copy link
Author

koji commented Apr 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment