diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67ce377cf..656482c7c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -162,26 +162,4 @@ To make sure its copy of CRDs is up-to-date, please, run `make all`. All documentation is stored under docs, for our homepage we are using hugo and the [docsy theme](https://github.com/google/docsy). If you don't feel the needs to preview the changes that you have done to the docs all you need to do is to edit them. -But if you want to see how your changes will look you need to install hugo locally. - -### Hugo - -When installing hugo install the `extended` edition, you can easily find it on there github page. -We are currently using [0.111.2](https://github.com/gohugoio/hugo/releases/tag/v0.111.2) but it probably works with other versions as well. - -To develop locally you need to also follow the docsy [pre-req](https://github.com/google/docsy#prerequisites). -But in most cases it should work to just run - -```shell -cd hugo -# Install npm dependencies -npm ci -# Download hugo module -hugo mod get -``` - -To look at your changes with hot reload. - -```shell -hugo serve -``` +But if you want to see how your changes will look you need to install hugo locally, see [Hugo ](./hugo/README.md) diff --git a/hugo/Makefile b/hugo/Makefile new file mode 100644 index 000000000..f380da43f --- /dev/null +++ b/hugo/Makefile @@ -0,0 +1,12 @@ +# Setting SHELL to bash allows bash commands to be executed by recipes. +# Options are set to exit when a recipe line exits non-zero or a piped command fails. +SHELL = /usr/bin/env bash -o pipefail +.SHELLFLAGS = -ec + +DOCS_URL ?= http//localhost:1313 + +.PHONY: detect-broken-links +detect-broken-links: + go install github.com/raviqqe/muffet/v2@latest + muffet --rate-limit=3 --max-connections=2 --buffer-size=8192 http://localhost:1313 + diff --git a/hugo/README.md b/hugo/README.md new file mode 100644 index 000000000..5ede6c25c --- /dev/null +++ b/hugo/README.md @@ -0,0 +1,34 @@ +# Hugo + +## Installing and running Hugo + +When installing hugo install the `extended` edition, you can easily find it on there github page. +We are currently using [0.111.2](https://github.com/gohugoio/hugo/releases/tag/v0.111.2) but it probably works with other versions as well. + +To develop locally you need to also follow the docsy [pre-req](https://github.com/google/docsy#prerequisites). +But in most cases it should work to just run + +```shell +cd hugo +# Install npm dependencies +npm ci +# Download hugo module +hugo mod get +``` + +To look at your changes with hot reload. + +```shell +hugo serve +``` + +## Detecting broken links in documentation + +To detect broken links in documentation using [muffet](https://github.com/raviqqe/muffet): + +1. Make sure that hugo is running and serving documentation as specified in the abbove steps. +2. Run the following command in the hugo directory: + +```shell +make detect-broken-links +```