From 6fe2b1154d2a5c7727dcd4664a2a7d7714623022 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:58:22 +0200 Subject: [PATCH] Add markdown output for docs homepage --- content/_index.md | 27 ++++++++++++++++++++ hack/releaser/cloudfront-lambda-redirects.js | 9 +++---- hugo.yaml | 1 + layouts/_partials/utils/markdown-url.html | 8 ++++-- layouts/home.markdown.md | 3 +++ 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 layouts/home.markdown.md diff --git a/content/_index.md b/content/_index.md index b49f900340..e78e0a1cc0 100644 --- a/content/_index.md +++ b/content/_index.md @@ -5,3 +5,30 @@ keywords: Docker, documentation, manual, guide, reference, api, samples aliases: - /search/ --- + +Docker Documentation helps you learn Docker, install Docker products, and find +reference material for everyday development and operations tasks. + +## Browse docs by area + +- [Get started](/get-started/): Learn Docker basics and core concepts. +- [Guides](/guides/): Follow task-focused walkthroughs for common workflows. +- [Manuals](/manuals/): Install, configure, and use Docker products. +- [Reference](/reference/): Browse CLI, API, and file format documentation. + +## Featured topics + +- [Docker Hardened Images](/dhi/) +- [Get started with Docker Sandboxes](/ai/sandboxes/get-started/) +- [Docker Desktop overview](/desktop/) +- [Install Docker Engine](/engine/install/) +- [Dockerfile reference](/reference/dockerfile/) +- [Docker Build overview](/build/) + +## Common questions + +- [How do I get started with Docker?](/get-started/docker-overview/) +- [Can I run my AI agent in a sandbox?](/ai/sandboxes/get-started/) +- [What is a container?](/get-started/docker-concepts/the-basics/what-is-a-container/) +- [What are Docker Hardened Images?](/dhi/) +- [Why should I use Docker Compose?](/compose/) diff --git a/hack/releaser/cloudfront-lambda-redirects.js b/hack/releaser/cloudfront-lambda-redirects.js index 2bd77b4ae7..6fbc40e5b1 100644 --- a/hack/releaser/cloudfront-lambda-redirects.js +++ b/hack/releaser/cloudfront-lambda-redirects.js @@ -69,10 +69,9 @@ exports.handler = (event, context, callback) => { if (!hasFileExtension) { if (wantsMarkdown) { // Markdown files are flattened: /path/to/page.md not /path/to/page/index.md. - // Homepage has no flattened equivalent, so serve llms.txt as the - // agent-oriented markdown index of the site. + // The homepage markdown output remains at /index.md. const stripped = uri.replace(/\/$/, ''); - uri = stripped === '' ? '/llms.txt' : stripped + '.md'; + uri = stripped === '' ? '/index.md' : stripped + '.md'; } else { // HTML uses directory structure with index.html if (!uri.endsWith("/")) { @@ -83,8 +82,8 @@ exports.handler = (event, context, callback) => { request.uri = uri; } else if (wantsMarkdown && uri.endsWith('/index.html')) { // If requesting index.html but wants markdown, use the flattened .md file. - // Root index.html has no flattened equivalent, so serve llms.txt instead. - uri = uri === '/index.html' ? '/llms.txt' : uri.replace(/\/index\.html$/, '.md'); + // The homepage markdown output lives at /index.md. + uri = uri === '/index.html' ? '/index.md' : uri.replace(/\/index\.html$/, '.md'); request.uri = uri; } diff --git a/hugo.yaml b/hugo.yaml index 61c2580ec7..72c1b5e2a8 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -114,6 +114,7 @@ outputFormats: outputs: home: - html + - markdown - redirects - metadata - robots diff --git a/layouts/_partials/utils/markdown-url.html b/layouts/_partials/utils/markdown-url.html index c1c7fadd1b..f9ac6fb3ef 100644 --- a/layouts/_partials/utils/markdown-url.html +++ b/layouts/_partials/utils/markdown-url.html @@ -1,2 +1,6 @@ -{{- $path := strings.TrimSuffix "/" .RelPermalink -}} -{{- printf "%s.md" $path | absURL -}} +{{- if .IsHome -}} + {{- absURL "/index.md" -}} +{{- else -}} + {{- $path := strings.TrimSuffix "/" .RelPermalink -}} + {{- printf "%s.md" $path | absURL -}} +{{- end -}} diff --git a/layouts/home.markdown.md b/layouts/home.markdown.md new file mode 100644 index 0000000000..239ce8eb50 --- /dev/null +++ b/layouts/home.markdown.md @@ -0,0 +1,3 @@ +# Docker Documentation + +{{ .RenderShortcodes }}