Skip to content

Instantly share code, notes, and snippets.

@talves
Created December 2, 2017 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talves/13721ef83fb5bf33dd1bc6b8de147d14 to your computer and use it in GitHub Desktop.
Save talves/13721ef83fb5bf33dd1bc6b8de147d14 to your computer and use it in GitHub Desktop.
Basic Netlify Build file for Hugo. Allows for targeting versions in previews.
# Global settings applied to the whole site.
[build]
publish = "public"
command = "hugo -d public"
[build.environment]
#overwritten by context.production.environment, et. al.
HUGO_VERSION = "0.31"
# The following environments overwrite the global above if you target them.
# The version you use for production
[context.production.environment]
HUGO_VERSION = "0.31"
# you can lock a version of hugo for a deploy preview
[context.deploy-preview.environment]
HUGO_VERSION = "0.31"
# you can lock a version of hugo for a branch-deploy (other than previews)
[context.branch-deploy.environment]
HUGO_VERSION = "0.31"
# build a preview of the site (Drafts and Future dates also)
[context.deploy-preview]
command = "hugo --buildDrafts --buildFuture"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment