Hugo Command Reference

Page content

Instead of constantly googling the same things that I need to do to update my site, I decided that it would be easiest to just create a page with all the commands.

Create a new page

hugo new [archtype]\[new-file-name].md

This will create a new markdown file in the specified directory. If the directory has a matching file in the archetypes directory, then it will be used as a template.

Run a local server

hugo server -D

This will publish a local version on https://localhost:1313. This will include pages that are marked as Draft versions. Check that everything is working as expected and either make changes, or continue to add the files to the private git repo.

Build the static pages

hugo

This will build the static pages that are marked as draft:false. You can now commit the files and push to the git repo. The files will be published to the directory that you specified in the config file, or to the default .\publish folder.

Commit changes

git add *

Add all the new files to the git working set.

git commit -a -m "[commit message]"

This will commit all the files to the local repo.

Push changes to git

git push

Push the changes to the remote repo.

Push to public git repo

Now you can commit the static pages to the public git repo so that your site will be updated. :)