ArjenSchwarz / wercker-step-hugo-build

Wercker Step for building Hugo sites
45 stars 19 forks source link
ci-cd hugo wercker-step

Wercker Step Hugo Build

wercker status

This step will download the specified version of Hugo and run this over the source code to generate the static version of your site. This can then automatically be deployed using other steps.

To speed things up, this step has the latest two versions of Hugo already installed thereby skipping the download part of the step.

Tutorial

If you are new to Wercker, there is a full tutorial on how to use this step in combination with an automatic deployment step in the Hugo documentation.

Requirements

This step does not require any specific container.

Breaking changes in 2.0.0

Version 2.0.0 of this step was released using Wercker's new step building system, and in doing so breaking changes were introduced.

Hugo Extended Version

Starting with Hugo 0.43 there is an extended version of Hugo available that supports SASS compiling and other functionalities. Per version 2.8.0 of this step, that is the version being used when using Hugo 0.43 or higher.

Parameters

version parameter

This parameter specifies the version of Hugo to be used, by default this is "0.74.3". It is recommended to set this, so you don't accidentally build you site with a version it isn't ready for. You can look up valid version numbers here - note that you need to specify the minor version number (0 in "0.61.0") as well - skipping it will not work. Due to Wercker not being able to properly handle 0.x version numbers, you will need to put quotes around the version number.

You can specify "HEAD" as the version, which will pull in the latest code of the Hugo master branch from GitHub and compile it. Please note that this means using a version of Hugo that is not released and might be unstable, so use this at your own risk.

Example wercker.yml

box: debian
build:
  steps:
    - arjen/hugo-build:
        version: "0.74.3"
        theme: redlounge
        config: second-config.toml
        flags: --disableKinds=["sitemap"]