Skip to content

Commit 1f1df42

Browse files
authored
Merge pull request #24901 from dvdksn/fix/home-markdown-output
fix/home markdown output
2 parents 93c783b + b299a17 commit 1f1df42

6 files changed

Lines changed: 112 additions & 19 deletions

File tree

content/_index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,30 @@ keywords: Docker, documentation, manual, guide, reference, api, samples
55
aliases:
66
- /search/
77
---
8+
9+
Docker Documentation helps you learn Docker, install Docker products, and find
10+
reference material for everyday development and operations tasks.
11+
12+
## Browse docs by area
13+
14+
- [Get started](/get-started/): Learn Docker basics and core concepts.
15+
- [Guides](/guides/): Follow task-focused walkthroughs for common workflows.
16+
- [Manuals](/manuals/): Install, configure, and use Docker products.
17+
- [Reference](/reference/): Browse CLI, API, and file format documentation.
18+
19+
## Featured topics
20+
21+
- [Docker Hardened Images](/dhi/)
22+
- [Get started with Docker Sandboxes](/ai/sandboxes/get-started/)
23+
- [Docker Desktop overview](/desktop/)
24+
- [Install Docker Engine](/engine/install/)
25+
- [Dockerfile reference](/reference/dockerfile/)
26+
- [Docker Build overview](/build/)
27+
28+
## Common questions
29+
30+
- [How do I get started with Docker?](/get-started/docker-overview/)
31+
- [Can I run my AI agent in a sandbox?](/ai/sandboxes/get-started/)
32+
- [What is a container?](/get-started/docker-concepts/the-basics/what-is-a-container/)
33+
- [What are Docker Hardened Images?](/dhi/)
34+
- [Why should I use Docker Compose?](/compose/)

hack/releaser/cloudfront-lambda-redirects.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ exports.handler = (event, context, callback) => {
6969
if (!hasFileExtension) {
7070
if (wantsMarkdown) {
7171
// Markdown files are flattened: /path/to/page.md not /path/to/page/index.md.
72-
// Homepage has no flattened equivalent, so serve llms.txt as the
73-
// agent-oriented markdown index of the site.
72+
// The homepage markdown output remains at /index.md.
7473
const stripped = uri.replace(/\/$/, '');
75-
uri = stripped === '' ? '/llms.txt' : stripped + '.md';
74+
uri = stripped === '' ? '/index.md' : stripped + '.md';
7675
} else {
7776
// HTML uses directory structure with index.html
7877
if (!uri.endsWith("/")) {
@@ -83,8 +82,8 @@ exports.handler = (event, context, callback) => {
8382
request.uri = uri;
8483
} else if (wantsMarkdown && uri.endsWith('/index.html')) {
8584
// If requesting index.html but wants markdown, use the flattened .md file.
86-
// Root index.html has no flattened equivalent, so serve llms.txt instead.
87-
uri = uri === '/index.html' ? '/llms.txt' : uri.replace(/\/index\.html$/, '.md');
85+
// The homepage markdown output lives at /index.md.
86+
uri = uri === '/index.html' ? '/index.md' : uri.replace(/\/index\.html$/, '.md');
8887
request.uri = uri;
8988
}
9089

hugo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ outputFormats:
114114
outputs:
115115
home:
116116
- html
117+
- markdown
117118
- redirects
118119
- metadata
119120
- robots
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
{{- $path := strings.TrimSuffix "/" .RelPermalink -}}
2-
{{- printf "%s.md" $path | absURL -}}
1+
{{- if .IsHome -}}
2+
{{- absURL "/index.md" -}}
3+
{{- else -}}
4+
{{- $path := strings.TrimSuffix "/" .RelPermalink -}}
5+
{{- printf "%s.md" $path | absURL -}}
6+
{{- end -}}

layouts/home.llms.txt

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,81 @@
1-
{{- $pages := where site.RegularPages "Params.sitemap" "!=" false -}}
2-
{{- $sorted := sort $pages "RelPermalink" -}}
3-
{{- $grouped := $sorted.GroupBy "Section" -}}
1+
{{- $home := site.Home -}}
2+
{{- $manuals := site.GetPage "/manuals" -}}
3+
{{- $getStarted := site.GetPage "/get-started" -}}
4+
{{- $reference := site.GetPage "/reference" -}}
45

56
# Docker Documentation
67

8+
{{ with $home.Description -}}
9+
{{ chomp (replace . "\n" " ") }}
10+
{{- else -}}
11+
Docker Documentation is the official documentation site for Docker products,
12+
including Docker Desktop, Docker Engine, Docker Build, Docker Compose, Docker
13+
Hub, Docker Scout, and Docker AI features.
14+
{{- end }}
15+
16+
Use this file as a generated discovery guide for the docs site. For the complete
17+
page index, use [llms-full.txt](https://docs.docker.com/llms-full.txt).
18+
719
> MCP endpoint for structured agent access: https://mcp-docs.docker.com/mcp
820
> Bulk text corpus for offline indexing: https://docs.docker.com/llms-full.txt
9-
{{- range $grouped }}
1021

11-
## {{ humanize .Key }}
12-
{{- range .Pages }}
13-
{{- template "pageItem" . }}
22+
## Primary sections
23+
24+
{{- range sort (where site.Sections "Title" "!=" "") "Weight" }}
25+
{{- if not (in (slice "includes" "tags") .Section) }}
26+
- [{{ .LinkTitle | default .Title }}]({{ .Permalink }}): {{ with .Description }}{{ chomp (replace . "\n" " ") }}{{ else }}{{ .Title }} documentation.{{ end }}
27+
Markdown: {{ partial "utils/markdown-url.html" . }}
28+
{{- end }}
29+
{{- end }}
30+
31+
{{ with $getStarted }}
32+
## Starter paths
33+
34+
{{- range index .Params "get-started" }}
35+
- [{{ .title }}]({{ .link | absURL }}): {{ .description }}
36+
{{- end }}
37+
{{- range index .Params "get-started2" }}
38+
- [{{ .title }}]({{ .link | absURL }}): {{ .description }}
39+
{{- end }}
40+
{{- end }}
41+
42+
{{ with $manuals }}
43+
## Product documentation
44+
45+
{{- range .Params.sidebar.groups }}
46+
{{- $group := . }}
47+
{{- $items := index $manuals.Params ($group | anchorize) }}
48+
{{- with $items }}
49+
50+
### {{ $group }}
51+
{{- range . }}
52+
- [{{ .title }}]({{ .link | absURL }}): {{ .description }}
53+
{{- end }}
54+
{{- end }}
55+
{{- end }}
56+
{{- end }}
57+
58+
{{ with $reference }}
59+
## Reference entry points
60+
61+
### File formats
62+
{{- range .Params.grid_files }}
63+
- [{{ .title }}]({{ .link | absURL }}): {{ .description }}
64+
{{- end }}
65+
66+
### Command-line interfaces
67+
{{- range .Params.grid_clis }}
68+
- [{{ .title }}]({{ .link | absURL }}): {{ .description }}
1469
{{- end }}
15-
{{- end -}}
1670

17-
{{- define "pageItem" }}
18-
{{- if and .Title .Permalink }}
19-
- [{{ .Title }}]({{ .Permalink }})
20-
{{- with .Description }}: {{ chomp (replace . "\n" " ") }}{{- end }}
71+
### APIs
72+
{{- range .Params.grid_apis }}
73+
- [{{ .title }}]({{ .link | absURL }}): {{ .description }}
2174
{{- end }}
2275
{{- end }}
76+
77+
## Retrieval guidance
78+
79+
- Prefer section landing pages above for navigation and scope selection.
80+
- Use [llms-full.txt](https://docs.docker.com/llms-full.txt) when you need the complete documentation corpus.
81+
- Use page-level markdown routes such as `https://docs.docker.com/engine/install.md` for clean per-page retrieval.

layouts/home.markdown.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Docker Documentation
2+
3+
{{ .RenderShortcodes }}

0 commit comments

Comments
 (0)