Add markdown output for docs homepage

This commit is contained in:
David Karlsson
2026-04-24 14:58:22 +02:00
parent 705b5b4dba
commit 6fe2b1154d
5 changed files with 41 additions and 7 deletions
+27
View File
@@ -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/)
+4 -5
View File
@@ -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;
}
+1
View File
@@ -114,6 +114,7 @@ outputFormats:
outputs:
home:
- html
- markdown
- redirects
- metadata
- robots
+6 -2
View File
@@ -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 -}}
+3
View File
@@ -0,0 +1,3 @@
# Docker Documentation
{{ .RenderShortcodes }}