From b619ed27d3e4405ae1416ffdb749799087bb39ec Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Mon, 12 Jan 2026 13:02:07 +0100 Subject: [PATCH 01/10] hugo: improve shortcode rendering for markdown output Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- hugo.yaml | 4 ++++ layouts/shortcodes/accordion.markdown.md | 5 +++++ layouts/shortcodes/badge.markdown.md | 1 + layouts/shortcodes/button.markdown.md | 3 +++ layouts/shortcodes/card.markdown.md | 1 + layouts/shortcodes/cta.markdown.md | 1 + .../shortcodes/desktop-install-v2.markdown.md | 22 +++++++++++++++++++ layouts/shortcodes/experimental.markdown.md | 3 +++ layouts/shortcodes/grid.markdown.md | 1 + layouts/shortcodes/inline-image.markdown.md | 4 ++++ layouts/shortcodes/restricted.markdown.md | 3 +++ layouts/shortcodes/rss-button.markdown.md | 1 + layouts/shortcodes/summary-bar.markdown.md | 1 + layouts/shortcodes/tabs.markdown.md | 6 +++++ layouts/shortcodes/youtube-embed.markdown.md | 1 + 15 files changed, 57 insertions(+) create mode 100644 layouts/shortcodes/accordion.markdown.md create mode 100644 layouts/shortcodes/badge.markdown.md create mode 100644 layouts/shortcodes/button.markdown.md create mode 100644 layouts/shortcodes/card.markdown.md create mode 100644 layouts/shortcodes/cta.markdown.md create mode 100644 layouts/shortcodes/desktop-install-v2.markdown.md create mode 100644 layouts/shortcodes/experimental.markdown.md create mode 100644 layouts/shortcodes/grid.markdown.md create mode 100644 layouts/shortcodes/inline-image.markdown.md create mode 100644 layouts/shortcodes/restricted.markdown.md create mode 100644 layouts/shortcodes/rss-button.markdown.md create mode 100644 layouts/shortcodes/summary-bar.markdown.md create mode 100644 layouts/shortcodes/tabs.markdown.md create mode 100644 layouts/shortcodes/youtube-embed.markdown.md diff --git a/hugo.yaml b/hugo.yaml index 369dc8d8c411..19dbcca1edf9 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -92,6 +92,10 @@ outputs: section: - html - markdown + taxonomy: + - html + term: + - html languages: en: diff --git a/layouts/shortcodes/accordion.markdown.md b/layouts/shortcodes/accordion.markdown.md new file mode 100644 index 000000000000..323631d5bb76 --- /dev/null +++ b/layouts/shortcodes/accordion.markdown.md @@ -0,0 +1,5 @@ +{{ $title := .Get "title" -}} +{{ $body := .InnerDeindent -}} +**{{ $title }}** + +{{ $body }} diff --git a/layouts/shortcodes/badge.markdown.md b/layouts/shortcodes/badge.markdown.md new file mode 100644 index 000000000000..9bcae182a4a1 --- /dev/null +++ b/layouts/shortcodes/badge.markdown.md @@ -0,0 +1 @@ +{{ $text := .Get "text" }}\[{{ $text }}\] diff --git a/layouts/shortcodes/button.markdown.md b/layouts/shortcodes/button.markdown.md new file mode 100644 index 000000000000..345e6a1908fa --- /dev/null +++ b/layouts/shortcodes/button.markdown.md @@ -0,0 +1,3 @@ +{{ $text := .Get "text" -}} +{{ $url := .Get "url" -}} +[{{ $text }}]({{ $url }}) diff --git a/layouts/shortcodes/card.markdown.md b/layouts/shortcodes/card.markdown.md new file mode 100644 index 000000000000..3ee941a0a693 --- /dev/null +++ b/layouts/shortcodes/card.markdown.md @@ -0,0 +1 @@ +{{/* Card omitted from markdown output */}} \ No newline at end of file diff --git a/layouts/shortcodes/cta.markdown.md b/layouts/shortcodes/cta.markdown.md new file mode 100644 index 000000000000..c2fc437f3d95 --- /dev/null +++ b/layouts/shortcodes/cta.markdown.md @@ -0,0 +1 @@ +{{/* CTA omitted from markdown output */}} \ No newline at end of file diff --git a/layouts/shortcodes/desktop-install-v2.markdown.md b/layouts/shortcodes/desktop-install-v2.markdown.md new file mode 100644 index 000000000000..880e00f6fa61 --- /dev/null +++ b/layouts/shortcodes/desktop-install-v2.markdown.md @@ -0,0 +1,22 @@ +{{- $all := .Get "all" -}} +{{- $win := .Get "win" -}} +{{- $win_arm_release := .Get "win_arm_release" -}} +{{- $mac := .Get "mac" -}} +{{- $linux := .Get "linux" -}} +{{- $build_path := .Get "build_path" -}} +Download Docker Desktop: +{{- if or $all $win }} +- [Windows](https://desktop.docker.com/win/main/amd64{{ $build_path }}Docker%20Desktop%20Installer.exe) +{{- end }} +{{- if $win_arm_release }} +- [Windows ARM {{ $win_arm_release }}](https://desktop.docker.com/win/main/arm64{{ $build_path }}Docker%20Desktop%20Installer.exe) +{{- end }} +{{- if or $all $mac }} +- [Mac (Apple chip)](https://desktop.docker.com/mac/main/arm64{{ $build_path }}Docker.dmg) +- [Mac (Intel chip)](https://desktop.docker.com/mac/main/amd64{{ $build_path }}Docker.dmg) +{{- end }} +{{- if or $all $linux }} +- [Linux (Debian)](https://desktop.docker.com/linux/main/amd64{{ $build_path }}docker-desktop-amd64.deb) +- [Linux (RPM)](https://desktop.docker.com/linux/main/amd64{{ $build_path }}docker-desktop-x86_64.rpm) +- [Linux (Arch)](https://desktop.docker.com/linux/main/amd64{{ $build_path }}docker-desktop-x86_64.pkg.tar.zst) +{{- end }} diff --git a/layouts/shortcodes/experimental.markdown.md b/layouts/shortcodes/experimental.markdown.md new file mode 100644 index 000000000000..9da71ee33313 --- /dev/null +++ b/layouts/shortcodes/experimental.markdown.md @@ -0,0 +1,3 @@ +> **{{ .Get "title" | default (i18n "experimental") }}** +> +> {{ .InnerDeindent }} diff --git a/layouts/shortcodes/grid.markdown.md b/layouts/shortcodes/grid.markdown.md new file mode 100644 index 000000000000..8c88897104ff --- /dev/null +++ b/layouts/shortcodes/grid.markdown.md @@ -0,0 +1 @@ +{{/* Grid omitted from markdown output */}} \ No newline at end of file diff --git a/layouts/shortcodes/inline-image.markdown.md b/layouts/shortcodes/inline-image.markdown.md new file mode 100644 index 000000000000..26b12c9383a7 --- /dev/null +++ b/layouts/shortcodes/inline-image.markdown.md @@ -0,0 +1,4 @@ +{{ $src := .Get "src" }} +{{ $alt := .Get "alt" }} +{{ $title := .Get "title" }} +![{{ $alt }}]({{ $src }}{{ with $title }} "{{ . }}"{{ end }}) \ No newline at end of file diff --git a/layouts/shortcodes/restricted.markdown.md b/layouts/shortcodes/restricted.markdown.md new file mode 100644 index 000000000000..dd18b991b61f --- /dev/null +++ b/layouts/shortcodes/restricted.markdown.md @@ -0,0 +1,3 @@ +> **{{ .Get "title" | default (i18n "restricted") }}** +> +> {{ .InnerDeindent }} diff --git a/layouts/shortcodes/rss-button.markdown.md b/layouts/shortcodes/rss-button.markdown.md new file mode 100644 index 000000000000..bf8eebe923ba --- /dev/null +++ b/layouts/shortcodes/rss-button.markdown.md @@ -0,0 +1 @@ +{{/* RSS button omitted from markdown output */}} \ No newline at end of file diff --git a/layouts/shortcodes/summary-bar.markdown.md b/layouts/shortcodes/summary-bar.markdown.md new file mode 100644 index 000000000000..1434bcbee649 --- /dev/null +++ b/layouts/shortcodes/summary-bar.markdown.md @@ -0,0 +1 @@ +{{/* Summary bar omitted from markdown output */}} \ No newline at end of file diff --git a/layouts/shortcodes/tabs.markdown.md b/layouts/shortcodes/tabs.markdown.md new file mode 100644 index 000000000000..dc4f50c50fc7 --- /dev/null +++ b/layouts/shortcodes/tabs.markdown.md @@ -0,0 +1,6 @@ +{{ with .Inner }}{{/* don't do anything, just call it */}}{{ end -}} +{{ range (.Store.Get "tabs") -}} +**{{ .name }}** + +{{ .content }} +{{- end -}} diff --git a/layouts/shortcodes/youtube-embed.markdown.md b/layouts/shortcodes/youtube-embed.markdown.md new file mode 100644 index 000000000000..3dde39c8c007 --- /dev/null +++ b/layouts/shortcodes/youtube-embed.markdown.md @@ -0,0 +1 @@ +{{/* YouTube embed omitted from markdown output */}} \ No newline at end of file From 58ca053f9826ab68c4fc39a723b2799abdb8b11d Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Mon, 12 Jan 2026 13:42:20 +0100 Subject: [PATCH 02/10] hugo: add post-process script to flatten markdown files Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- Dockerfile | 1 + hack/flatten-markdown.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 hack/flatten-markdown.sh diff --git a/Dockerfile b/Dockerfile index aa4957bce567..2ec633711fc3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,7 @@ ARG DOCS_URL="https://docs.docker.com" ENV HUGO_CACHEDIR="/tmp/hugo_cache" RUN --mount=type=cache,target=/tmp/hugo_cache \ hugo --gc --minify -e $HUGO_ENV -b $DOCS_URL +RUN ./hack/flatten-markdown.sh public # lint lints markdown files FROM ghcr.io/igorshubovych/markdownlint-cli:v0.45.0 AS lint diff --git a/hack/flatten-markdown.sh b/hack/flatten-markdown.sh new file mode 100755 index 000000000000..d055dc9bdb34 --- /dev/null +++ b/hack/flatten-markdown.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +# Flatten markdown files from public/path/to/page/index.md to public/path/to/page.md +# This makes markdown output links work correctly + +PUBLIC_DIR="${1:-public}" + +[ -d "$PUBLIC_DIR" ] || { echo "Error: Directory $PUBLIC_DIR does not exist"; exit 1; } + +find "$PUBLIC_DIR" -type f -name 'index.md' | while read -r file; do + # Skip the root index.md + [ "$file" = "$PUBLIC_DIR/index.md" ] && continue + + # Get the directory containing index.md + dir="${file%/*}" + + # Move index.md to parent directory with directory name + mv "$file" "${dir%/*}/${dir##*/}.md" +done + +echo "Flattened markdown files in $PUBLIC_DIR" From b3a1fe27ba2b5bbd8659a9025f20df8aff82582b Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Mon, 12 Jan 2026 13:42:38 +0100 Subject: [PATCH 03/10] site: add rel link to markdown output Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- layouts/partials/head.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4c1455512c37..18bdb010b718 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,6 +1,9 @@ {{ partial "meta.html" . }} +{{- range .AlternativeOutputFormats -}} + +{{ end -}} {{ partial "utils/css.html" "-" }} {{- if hugo.IsProduction -}}