Skip to content

Commit f3280cc

Browse files
Merge pull request #22350 from docker/published-update
publish updates from main
2 parents f05285b + a4eda2c commit f3280cc

File tree

10 files changed

+188
-7
lines changed

10 files changed

+188
-7
lines changed

hugo.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,36 @@ outputFormats:
7474
isPlainText: true
7575
mediaType: "text/plain"
7676
notAlternative: true
77+
# Markdown for LLMs, see layouts/_default/single.markdown.md
78+
Markdown:
79+
baseName: index
80+
mediaType: "text/markdown"
81+
isPlainText: true
82+
isHTML: false
83+
permalinkable: false
84+
# llms.txt
85+
llms:
86+
baseName: llms
87+
isPlainText: true
88+
mediaType: "text/plain"
89+
notAlternative: true
90+
permalinkable: false
7791

78-
# Enable custom output formats for the home page only
92+
# Enable custom output formats
7993
# (only generate the custom output files once)
8094
outputs:
8195
home:
8296
- html
8397
- redirects
8498
- metadata
8599
- robots
100+
- llms
101+
page:
102+
- html
103+
- Markdown
104+
section:
105+
- html
106+
- Markdown
86107

87108
languages:
88109
en:

hugo_stats.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
"With-systemd-Highly-recommended",
129129
"Without-packages",
130130
"Without-systemd",
131+
"[display:none]",
131132
"absolute",
132133
"aspect-video",
133134
"bake-action",
@@ -219,6 +220,7 @@
219220
"dark:hover:bg-blue-dark",
220221
"dark:hover:bg-blue-dark-500",
221222
"dark:hover:bg-gray-dark-200",
223+
"dark:hover:bg-gray-dark-400",
222224
"dark:hover:bg-gray-dark-500",
223225
"dark:hover:text-blue-dark",
224226
"dark:prose-invert",
@@ -284,6 +286,8 @@
284286
"grid-cols-1",
285287
"group",
286288
"group-hover:block'",
289+
"group-open:[display:block]",
290+
"group-open:rotate-180",
287291
"h-16",
288292
"h-2",
289293
"h-32",
@@ -318,6 +322,7 @@
318322
"icon-sm",
319323
"icon-svg",
320324
"inline",
325+
"inline-block",
321326
"inline-flex",
322327
"inset-0",
323328
"invertible",
@@ -329,7 +334,9 @@
329334
"justify-center",
330335
"justify-end",
331336
"justify-evenly",
337+
"leading-none",
332338
"leading-snug",
339+
"leading-tight",
333340
"left-0",
334341
"lg:block",
335342
"lg:flex",
@@ -384,11 +391,13 @@
384391
"ml-2",
385392
"ml-3",
386393
"ml-4",
394+
"ml-auto",
387395
"mt-1",
388396
"mt-2",
389397
"mt-20",
390398
"mt-4",
391399
"mt-8",
400+
"mt-[2px]",
392401
"mx-auto",
393402
"my-0",
394403
"my-1",
@@ -401,6 +410,7 @@
401410
"open-kapa-widget",
402411
"openSUSE-and-SLES",
403412
"origin-bottom-right",
413+
"origin-top-right",
404414
"ot-sdk-show-settings",
405415
"outline-none",
406416
"overflow-clip",
@@ -465,6 +475,7 @@
465475
"self-start",
466476
"shadow",
467477
"shadow-lg",
478+
"shadow-md",
468479
"sm:block",
469480
"sm:flex",
470481
"sm:flex-row",
@@ -514,10 +525,13 @@
514525
"top-6",
515526
"top-full",
516527
"transition",
528+
"transition-colors",
529+
"transition-transform",
517530
"truncate",
518531
"underline-offset-2",
519532
"uppercase",
520533
"w-2",
534+
"w-56",
521535
"w-8",
522536
"w-[1200px]",
523537
"w-[32px]",

layouts/_default/index.llms.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- $pages := .Site.RegularPages -}}
2+
{{- $sorted := sort $pages "RelPermalink" -}}
3+
{{- $grouped := $sorted.GroupBy "Section" -}}
4+
5+
# Docker Documentation
6+
7+
{{ range $grouped }}
8+
## {{ humanize .Key }}
9+
{{ range .Pages }}
10+
- [{{ .Title }}]({{ .Permalink }}){{ end }}
11+
{{ end -}}

layouts/_default/list.markdown.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ .Title }}
2+
3+
{{ .RawContent }}
4+
5+
{{ range .Pages }}
6+
- [{{ .Title }}](https://docs.docker.com{{ .RelPermalink }})
7+
{{ end }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{ .Title }}
2+
3+
{{ .RawContent }}

layouts/partials/aside.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
</div>
1313
{{- end }}
1414
{{- end }}
15-
</aside>
15+
</aside>
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
<div class="flex gap-8 w-full">
2-
<article class="prose min-w-0 flex-[2_2_0%] max-w-4xl dark:prose-invert">
1+
<div class="flex w-full gap-8">
2+
<article class="prose min-w-0 max-w-4xl flex-[2_2_0%] dark:prose-invert">
33
{{ partial "breadcrumbs.html" . }}
4-
<h1 data-pagefind-weight="10" class="scroll-mt-36">{{ .Title }}</h1>
4+
<h1 data-pagefind-weight="10" class="flex scroll-mt-36 items-center">
5+
<span>{{ .Title }}</span>
6+
<span class="ml-auto">
7+
{{ partial "md-dropdown.html" . }}
8+
</span>
9+
</h1>
510

611
<div class="block lg:hidden">
712
{{ partialCached "pagemeta.html" . . }}
813
<hr />
914
</div>
1015
{{ .Content }}
1116
</article>
12-
<div class="hidden flex-1 min-w-52 lg:block -mr-8 -mt-8">
17+
<div class="-mr-8 -mt-8 hidden min-w-52 flex-1 lg:block">
1318
{{ partial "aside.html" . }}
1419
</div>
1520
</div>

layouts/partials/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{{- with .GetPage "/contribute" }}
1111
<a class="underline-offset-2 hover:underline" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
1212
{{- end }}
13+
<a href="{{ "llms.txt" | relURL }}">Read llms.txt</a>
1314
</div>
1415
<hr class="text-divider-light dark:text-divider-dark" />
1516
<div class="grid lg:grid-cols-3 place-items-center gap-8 grid-cols-1">

layouts/partials/md-dropdown.html

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<details id="markdownDropdown" class="group relative z-10 inline-block" data-heap-id="markdown-dropdown">
2+
<summary
3+
class="inline-flex cursor-pointer items-center gap-2 rounded border border-gray-light-200 bg-gray-light-200 px-4 py-2 text-base font-semibold text-black transition-colors hover:bg-gray-light-300 dark:border-gray-dark-200 dark:bg-gray-dark-300 dark:text-white dark:hover:bg-gray-dark-400"
4+
data-heap-id="markdown-dropdown-toggle"
5+
>
6+
<span>Page options</span>
7+
<span class="icon-svg transition-transform group-open:rotate-180">
8+
{{ partialCached "icon" "arrow_drop_down" "arrow_drop_down" }}
9+
</span>
10+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
11+
</svg>
12+
</summary>
13+
14+
<!-- Dropdown menu -->
15+
<div
16+
class="absolute right-0 z-50 mt-2 w-56 origin-top-right rounded border border-gray-light-200 bg-gray-light-200 p-2 text-sm text-black shadow-md [display:none] group-open:[display:block] dark:border-gray-dark-200 dark:bg-gray-dark-300 dark:text-white"
17+
data-heap-id="markdown-dropdown-menu"
18+
>
19+
<button
20+
onclick="copyMarkdown()"
21+
data-heap-id="copy-markdown-button"
22+
class="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400"
23+
>
24+
<span class="icon-svg mt-[2px] text-base leading-none">
25+
{{ partial "icon" "content_copy" }}
26+
</span>
27+
<span class="icon-svg hidden mt-[2px] text-base leading-none">
28+
{{ partial "icon" "check_circle" }}
29+
</span>
30+
<div class="leading-tight">
31+
<div class="text-base">Copy page as Markdown for LLMs</div>
32+
</div>
33+
</button>
34+
35+
<button
36+
onclick="viewPlainText()"
37+
data-heap-id="view-markdown-button"
38+
class="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400"
39+
>
40+
<span class="icon-svg mt-[2px] text-base leading-none">
41+
{{ partial "icon" "description" }}
42+
</span>
43+
<div class="leading-tight">
44+
<div class="text-base">View page as plain text</div>
45+
</div>
46+
</button>
47+
48+
<button
49+
onclick="openInDocsAI()"
50+
data-heap-id="search-docs-ai-button"
51+
class="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400"
52+
>
53+
<span class="icon-svg mt-[2px] text-base leading-none">
54+
{{ partial "icon" "search" }}
55+
</span>
56+
<div class="leading-tight">
57+
<div class="text-base">Ask questions with Docs AI</div>
58+
</div>
59+
</button>
60+
</div>
61+
</details>
62+
63+
<script>
64+
function getCurrentPlaintextUrl() {
65+
const url = window.location.href.split("#")[0].replace(/\/$/, "");
66+
return `${url}/index.md`;
67+
}
68+
69+
function copyMarkdown() {
70+
fetch(getCurrentPlaintextUrl())
71+
.then((response) => response.text())
72+
.then((text) => {
73+
navigator.clipboard.writeText(text).then(() => {
74+
const button = document.querySelector('[data-heap-id="copy-markdown-button"]');
75+
if (!button) return;
76+
77+
const icons = button.querySelectorAll(".icon-svg");
78+
const copyIcon = icons[0];
79+
const checkIcon = icons[1];
80+
81+
copyIcon.classList.add("hidden");
82+
checkIcon.classList.remove("hidden");
83+
84+
setTimeout(() => {
85+
copyIcon.classList.remove("hidden");
86+
checkIcon.classList.add("hidden");
87+
}, 2000);
88+
});
89+
})
90+
.catch((err) => {
91+
console.error("Error copying markdown:", err);
92+
});
93+
}
94+
95+
function viewPlainText() {
96+
window.open(getCurrentPlaintextUrl(), "_blank");
97+
}
98+
99+
function openInDocsAI() {
100+
const kapaButton = document.querySelector(".open-kapa-widget");
101+
if (kapaButton) {
102+
kapaButton.click();
103+
} else {
104+
alert("Couldn't find Docs AI.");
105+
}
106+
}
107+
108+
document.addEventListener("click", function (event) {
109+
const dropdown = document.getElementById("markdownDropdown");
110+
111+
if (!dropdown) return;
112+
113+
const isClickInside = dropdown.contains(event.target);
114+
115+
if (!isClickInside && dropdown.hasAttribute("open")) {
116+
dropdown.removeAttribute("open");
117+
}
118+
});
119+
</script>

layouts/partials/sidebar/sections.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@
104104
{{- with .Params.sidebar.badge }}
105105
<span>{{- partial "components/badge.html" (dict "color" .color "content" .text) }}</span>
106106
{{- end }}
107-
{{ end }}
107+
{{ end }}

0 commit comments

Comments
 (0)