Building A Site Using The Latest Hugo on AppVeyor

Written by Khalid Abuhakmeh

Hugo recently released an amazing asset pipeline, which means you need less external dependencies to build a sweet static site. To take advantage of this new feature you need the “extended” version of Hugo. This post will show you how to download this extended version on AppVeyor and run your build.

AppVeyor.yml

Normally, we would use Chocolatey to install Hugo. This should be at the top of the appveyor.yml file in your repository.

install:
  - ps: choco install hugo

But the current version is not the extended version we need. We needed to switch the one line above, to the two below.

install:
  - ps: Start-FileDownload 'https://github.com/gohugoio/hugo/releases/download/v0.45.1/hugo_extended_0.45.1_Windows-64bit.zip'
  - ps: 7z x hugo_extended_0.45.1_Windows-64bit.zip

This downloads the latest release, as of this post, and extracts it locally (which seems to also be in the PATH). As a bonus, I call hugo version.

before_build:
  # Output useful info for debugging.
  - hugo version

When you run this, you’ll see we are running the extended version.

hugo version
Hugo Static Site Generator v0.45.1/extended windows/amd64 BuildDate: unknown

NPM Dev Depdency

I also noticed that we need PostCSS Cli as a dev dependency. If you start seeing errors around not being able to process a css file then you’ll need it as well.

npm i -D postcss-cli

This should make everthing build great now.

Published July 28, 2018 by

undefined avatar
Khalid Abuhakmeh Github Director of Software Development (Former)

Suggested Reading