Skip to content

Use this repository to test Hugo Docker containers

License

Notifications You must be signed in to change notification settings

jmooring/hugo-docker-test

Repository files navigation

Hugo Docker Test

Use this repository to test Docker images such as:

These live sites were built with a veriphor/hugo container:

This site is designed to test these features and capabilities:

  1. Including content from a Hugo module
  2. Transpiling Sass to CSS using Dart Sass
  3. Vendor prefixing of CSS rules using the postcss, postcss-cli, and autoprefixer Node.js packages
  4. Processing CSS files using the tailwindcss and @tailwindcss-cli Node.js packages
  5. Encoding images to the WebP format to verify that we're using Hugo's extended edition
  6. Including a content file named hugö.md to verify that the Git core.quotepath setting is false1
  7. Rendering of AsciiDoc content
  8. Rendering of Pandoc content
  9. Rendering of reStructuredText content
  10. Enabling site search with Pagefind

To test items 7-10 you must use the -e extra command line flag.

Using the official Docker image

Clone the repository:

git clone https://github.com/jmooring/hugo-docker-test
cd hugo-docker-test

Then see the Hugo documentation for the relevant operating system:

Note that the official Docker image does not support items 7-10 above.

Using the veriphor/hugo image

Clone the repository and install the Node.js packages:

git clone https://github.com/jmooring/hugo-docker-test
cd hugo-docker-test
npm ci

The commands below assume you have aliased dhugo to:

docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -u $(id -u):$(id -g) --network host veriphor/hugo hugo

Build the site without Pagefind:

dhugo server -e extra

Build the site using a local installation of the Pagefind executable:

dhugo -e extra && ./pagefind --site public --serve

Build the site using the Pagefind executable within the Docker image:

docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -u $(id -u):$(id -g) --network host veriphor/hugo bash -c "hugo -e extra && pagefind --site public --serve"

Footnotes

  1. See issue #9810. Git's core.quotepath setting is false if /other/hugö has a non-zero "last modified" date.

About

Use this repository to test Hugo Docker containers

Resources

License

Stars

Watchers

Forks