Simple Hugo test site to use in CI pipelines

#1

My themes used to have tests in a Travis CI pipeline using HugoBasicExample. However, HugoBasicExample is meant as a showcase for Hugo’s functionality, and not as something to base automatic tests on. The authors are currently giving it a major overhaul, which is a good thing, but it regularly broke my tests. In a recent change, the authors introduced inline shortcodes, which were only introduced in Hugo 0.52, making this repo unusable to test themes with older versions of Hugo.

Therefore, I’ve taken a stab at building a simple, stable Hugo site that can be used in CI pipelines. At the moment it is very simple, I know, but as I mainly use automatic tests to check that I haven’t forgotten to commit generated resources, for me it suffices for now. Feel free to use the repo for your own CI pipeline. The readme currently includes an example .travis.yml and I intend to add an example for CircleCI as well.

Find the repo here.

Feel free to leave comments or remarks; there’s probably a lot that can be improved!

I do have a few thoughts that I’m pondering:

  • Is it useful to have such a generic test site, or are themes better off including their own example site that can be also be used to test functionality specific to the theme?
  • Is it useful to test with older versions of Hugo? I like to test my theme on all versions starting with the minimum version I specified in my theme.toml, but how likely is it that people are stuck on these older versions?
0 Likes