/hugo-training-template

Primary LanguageHTMLCreative Commons Attribution Share Alike 4.0 InternationalCC-BY-SA-4.0

CHANGEME Training

CHANGEME Training Description

Content Sections

The training content resides within the content directory.

The main part are the labs, which can be found at content/en/docs.

Hugo

This site is built using the static page generator Hugo.

The page uses the docsy theme which is included as a Git Submodule.

After cloning the main repo, you need to initialize the submodule like this:

git submodule update --init --recursive

Build using Docker

Build the image:

docker build -t acend/changeme-training:latest .

Run it locally:

docker run -i -p 8080:8080 acend/changeme-training

Using Buildah and Podman

Build the image:

buildah build-using-dockerfile -t acend/changeme-training:latest .

Run it locally with the following command. Beware that --rmi automatically removes the built image when the container stops, so you either have to rebuild it or remove the parameter from the command.

podman run --rm --rmi --interactive --publish 8080:8080 localhost/acend/changeme-training

How to develop locally

To develop locally we don't want to rebuild the entire container image every time something changed, and it is also important to use the same hugo versions like in production. We simply mount the working directory into a running container, where hugo is started in the server mode.

docker run --rm --interactive --publish 8080:8080 -v $(pwd):/opt/app/src -w /opt/app/src acend/hugo:<version-in-dockerfile> hugo server -p 8080 --bind 0.0.0.0

Linting of Markdown content

Markdown files are linted with https://github.com/DavidAnson/markdownlint. Custom rules are in .markdownlint.json. There's a GitHub Action .github/workflows/markdownlint.yaml for CI. For local checks, you can either use Visual Studio Code with the corresponding extension, or the command line like this:

npm install
node_modules/.bin/markdownlint content

Contributions

If you find errors, bugs or missing information please help us improve and have a look at the Contribution Guide.