Skip to content

Commit 9b4b43f

Browse files
add llms.txt to repo
1 parent a64ea4d commit 9b4b43f

File tree

5 files changed

+100
-1
lines changed

5 files changed

+100
-1
lines changed

hugo.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,24 @@ outputFormats:
7474
isPlainText: true
7575
mediaType: "text/plain"
7676
notAlternative: true
77+
# llms.txt, see layouts/single.llmstxt.txt
78+
llmstxt:
79+
baseName: llms
80+
mediaType: "text/plain"
81+
isPlainText: true
82+
notAlternative: true
7783

78-
# Enable custom output formats for the home page only
84+
# Enable custom output formats
7985
# (only generate the custom output files once)
8086
outputs:
8187
home:
8288
- html
8389
- redirects
8490
- metadata
8591
- robots
92+
page:
93+
- html
94+
- llmstxt
8695

8796
languages:
8897
en:

hugo_stats.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
"dark:bg-background-dark",
189189
"dark:bg-blue-dark",
190190
"dark:bg-blue-dark-400",
191+
"dark:bg-gray-800",
191192
"dark:bg-gray-dark-100",
192193
"dark:bg-gray-dark-200",
193194
"dark:bg-gray-dark-300",
@@ -216,6 +217,7 @@
216217
"dark:from-blue-dark-400",
217218
"dark:from-gray-dark-100",
218219
"dark:hidden",
220+
"dark:hover:bg-blue-500",
219221
"dark:hover:bg-blue-dark",
220222
"dark:hover:bg-blue-dark-500",
221223
"dark:hover:bg-gray-dark-200",
@@ -228,6 +230,7 @@
228230
"dark:text-amber-dark",
229231
"dark:text-blue-dark",
230232
"dark:text-divider-dark",
233+
"dark:text-gray-400",
231234
"dark:text-gray-dark",
232235
"dark:text-gray-dark-300",
233236
"dark:text-gray-dark-500",
@@ -284,9 +287,11 @@
284287
"grid-cols-1",
285288
"group",
286289
"group-hover:block'",
290+
"group-open:rotate-180",
287291
"h-16",
288292
"h-2",
289293
"h-32",
294+
"h-4",
290295
"h-48",
291296
"h-6",
292297
"h-8",
@@ -298,6 +303,7 @@
298303
"hidden",
299304
"hidden'",
300305
"highlight",
306+
"hover:bg-blue-600",
301307
"hover:bg-blue-light-400",
302308
"hover:bg-gray-light-100",
303309
"hover:bg-gray-light-200",
@@ -311,13 +317,15 @@
311317
"hover:dark:text-blue-dark",
312318
"hover:drop-shadow-lg",
313319
"hover:opacity-90",
320+
"hover:text-blue-600",
314321
"hover:text-blue-light",
315322
"hover:text-white",
316323
"hover:underline",
317324
"icon-lg",
318325
"icon-sm",
319326
"icon-svg",
320327
"inline",
328+
"inline-block",
321329
"inline-flex",
322330
"inset-0",
323331
"invertible",
@@ -387,6 +395,7 @@
387395
"mt-1",
388396
"mt-2",
389397
"mt-20",
398+
"mt-3",
390399
"mt-4",
391400
"mt-8",
392401
"mx-auto",
@@ -410,6 +419,7 @@
410419
"overflow-y-auto",
411420
"p-1",
412421
"p-2",
422+
"p-3",
413423
"p-4",
414424
"p-6",
415425
"p-8",
@@ -435,6 +445,7 @@
435445
"pt-4",
436446
"px-1",
437447
"px-2",
448+
"px-3",
438449
"px-4",
439450
"px-6",
440451
"py-1",
@@ -446,15 +457,20 @@
446457
"right-0",
447458
"right-3",
448459
"right-8",
460+
"ring-1",
449461
"ring-2",
450462
"ring-[1.5px]",
463+
"ring-black",
451464
"ring-blue-light-400",
452465
"ring-gray-light-200",
466+
"ring-opacity-5",
453467
"rotate-45",
454468
"rounded",
455469
"rounded-[6px]",
456470
"rounded-b-lg",
457471
"rounded-full",
472+
"rounded-lg",
473+
"rounded-md",
458474
"rounded-sm",
459475
"scale-50",
460476
"scale-75",
@@ -465,6 +481,7 @@
465481
"self-start",
466482
"shadow",
467483
"shadow-lg",
484+
"shadow-sm",
468485
"sm:block",
469486
"sm:flex",
470487
"sm:flex-row",
@@ -473,6 +490,7 @@
473490
"sm:w-full",
474491
"space-x-2",
475492
"space-y-2",
493+
"space-y-3",
476494
"space-y-4",
477495
"sticky",
478496
"svg-container",
@@ -482,8 +500,10 @@
482500
"text-amber-light",
483501
"text-base",
484502
"text-black",
503+
"text-blue-500",
485504
"text-blue-light",
486505
"text-divider-light",
506+
"text-gray-500",
487507
"text-gray-light",
488508
"text-gray-light-200",
489509
"text-gray-light-300",
@@ -513,11 +533,16 @@
513533
"top-3",
514534
"top-6",
515535
"top-full",
536+
"transform",
516537
"transition",
538+
"transition-transform",
517539
"truncate",
518540
"underline-offset-2",
519541
"uppercase",
520542
"w-2",
543+
"w-4",
544+
"w-64",
545+
"w-72",
521546
"w-8",
522547
"w-[1200px]",
523548
"w-[32px]",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{ .Title }}
2+
3+
{{ .RawContent | replaceRE `{{[%<][^>]*[%>]}}` "" }}

layouts/partials/content-default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ <h1 data-pagefind-weight="10" class="scroll-mt-36">{{ .Title }}</h1>
88
<hr />
99
</div>
1010
{{ .Content }}
11+
{{ partial "llms-dropdown.html" . }}
1112
</article>
1213
<div class="hidden flex-1 min-w-52 lg:block -mr-8 -mt-8">
1314
{{ partial "aside.html" . }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<div class="my-4 p-4 rounded-lg bg-transparent">
2+
<details class="inline-block group">
3+
<summary class="inline-flex items-center gap-2 rounded bg-blue-light dark:bg-blue-dark text-white py-2 px-4 cursor-pointer font-semibold">
4+
<span>Copy llms.txt file</span>
5+
<svg
6+
class="h-2 w-2 transform transition-transform group-open:rotate-180"
7+
xmlns="http://www.w3.org/2000/svg"
8+
fill="none"
9+
viewBox="0 0 24 24"
10+
stroke="currentColor"
11+
>
12+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
13+
</svg>
14+
</summary>
15+
<div class="mt-3 space-y-4 text-sm pl-5">
16+
<div>
17+
<button onclick="copyMarkdown()" class="text-left text-blue-500 hover:text-blue-600 font-semibold">Copy page</button>
18+
<div class="text-gray-500 dark:text-gray-400">Copy this page as Markdown for LLMs</div>
19+
</div>
20+
<div>
21+
<button onclick="viewPlainText()" class="text-left text-blue-500 hover:text-blue-600 font-semibold">View as Markdown</button>
22+
<div class="text-gray-500 dark:text-gray-400">View this page as plain text</div>
23+
</div>
24+
<div>
25+
<button onclick="openInDocsAI()" class="text-left text-blue-500 hover:text-blue-600 font-semibold">Open in Docker Docs AI</button>
26+
<div class="text-gray-500 dark:text-gray-400">Ask questions about this page with Docker Docs AI</div>
27+
</div>
28+
</div>
29+
</details>
30+
</div>
31+
32+
<script>
33+
function getCurrentPlaintextUrl() {
34+
const currentUrl = window.location.href.split('#')[0].replace(/\/$/, '');
35+
return `${currentUrl}/llms.txt`;
36+
}
37+
38+
function copyMarkdown() {
39+
fetch(getCurrentPlaintextUrl())
40+
.then(response => response.text())
41+
.then(text => {
42+
navigator.clipboard.writeText(text)
43+
.then(() => alert('Markdown copied to clipboard!'))
44+
.catch(err => alert('Failed to copy markdown: ', err));
45+
})
46+
.catch(err => alert('Error fetching markdown: ', err));
47+
}
48+
49+
function viewPlainText() {
50+
window.open(getCurrentPlaintextUrl(), '_blank');
51+
}
52+
53+
function openInDocsAI() {
54+
const kapaButton = document.querySelector('.open-kapa-widget');
55+
if (kapaButton) {
56+
kapaButton.click();
57+
} else {
58+
alert("Couldn't find the DocsAI button.");
59+
}
60+
}
61+
</script>

0 commit comments

Comments
 (0)