Skip to content

Commit 5593f3e

Browse files
authored
Add LLMS output and llms.txt support, enables it over docsy.dev (#2605)
1 parent 97014de commit 5593f3e

22 files changed

Lines changed: 310 additions & 45 deletions

File tree

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"hugo",
2929
"isset",
3030
"lastmod",
31+
"llms",
3132
"markdownify",
3233
"mentees",
3334
"navbars",

docsy.dev/agent-docs.config.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Agent-Friendly Docs — https://afdocs.dev/reference/config-file.html
2+
3+
url: https://www.docsy.dev # Site to check. CLI flag overrides this
4+
5+
checks:
6+
# --- Content Discoverability ---
7+
- llms-txt-exists
8+
- llms-txt-valid
9+
- llms-txt-size
10+
- llms-txt-links-resolve
11+
- llms-txt-links-markdown
12+
- llms-txt-directive
13+
14+
# --- Markdown Availability ---
15+
- markdown-url-support
16+
- content-negotiation
17+
18+
# --- Page Size and Truncation Risk ---
19+
- rendering-strategy
20+
- page-size-markdown
21+
- page-size-html
22+
# - content-start-position
23+
24+
# --- Content Structure ---
25+
- tabbed-content-serialization
26+
- section-header-quality
27+
- markdown-code-fence-validity
28+
29+
# --- URL Stability and Redirects ---
30+
- http-status-codes
31+
- redirect-behavior
32+
33+
# --- Observability and Content Health ---
34+
# - llms-txt-freshness
35+
# - markdown-content-parity
36+
- cache-header-hygiene
37+
38+
# --- Authentication and Access ---
39+
- auth-gate-detection
40+
- auth-alternative-access
41+
42+
# options:
43+
# maxLinksToTest: 50
44+
# samplingStrategy: random # random | deterministic | none
45+
# maxConcurrency: 3
46+
# requestDelay: 200
47+
# requestTimeout: 30000
48+
# thresholds:
49+
# pass: 50000
50+
# fail: 100000

docsy.dev/config/_default/hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ignoreLogs:
1212
- warning-frontmatter-params-overrides # cSpell:disable-line
1313

1414
outputs:
15-
home: [HTML, markdown]
15+
home: [HTML, markdown, LLMS]
1616
page: [HTML, markdown]
1717
section: [HTML, RSS, print, markdown]
1818

docsy.dev/content/fr/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description: >-
55
params:
66
body_class: td-navbar-links-all-active
77
ui: { navbar_theme: dark }
8+
outputs: [HTML, markdown]
89
---
910

1011
{{% blocks/cover

docsy.dev/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"scripts": {
66
"_build": "npm run _hugo-dev --",
7+
"_check:afdocs": "npx afdocs check --config agent-docs.config.yml --format scorecard",
78
"_check:format": "npx prettier --config ../.prettierrc.json --check .",
89
"_check:links--warn": "npm run _check:links || (echo; echo 'WARNING: see link-checker output for issues.'; echo)",
910
"_check:links": "make --keep-going check-links",
@@ -39,6 +40,7 @@
3940
"update:packages": "npx npm-check-updates -u"
4041
},
4142
"devDependencies": {
43+
"afdocs": "^0.9.2",
4244
"autoprefixer": "^10.4.27",
4345
"cross-env": "^10.1.0",
4446
"hugo-extended": "0.157.0",
@@ -47,5 +49,5 @@
4749
"postcss-cli": "^11.0.1",
4850
"rtlcss": "^4.3.0"
4951
},
50-
"cSpell:ignore": "- docsy htmltest postbuild precheck refcache rtlcss -"
52+
"cSpell:ignore": "- afdocs docsy htmltest postbuild precheck refcache rtlcss -"
5153
}

docsy.dev/tests/md-output/golden.test.mjs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@ const goldenDir = fileURLToPath(new URL('./goldens/', import.meta.url));
88
const publicDir = fileURLToPath(new URL('../../public/', import.meta.url));
99

1010
// `kind` is descriptive only (for readable test names); it doesn't affect test logic.
11+
// `skip: true` omits the assertion (manifest entry is kept for docs / update-goldens).
1112
const manifest = JSON.parse(
1213
readFileSync(new URL('./goldens.json', import.meta.url), 'utf8'),
1314
);
1415

15-
for (const { path, kind, covers } of manifest) {
16-
test(`${path} (${kind}) — ${covers.join(', ')}`, () => {
16+
for (const { path, kind, covers, skip } of manifest) {
17+
const name = `${path} (${kind}) — ${covers.join(', ')}`;
18+
const run = () => {
1719
const expected = readFileSync(join(goldenDir, path), 'utf8');
1820
const actual = readFileSync(join(publicDir, path), 'utf8');
1921
assert.equal(actual, expected);
20-
});
22+
};
23+
if (skip) {
24+
test.skip(name, run);
25+
} else {
26+
test(name, run);
27+
}
2128
}
Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,50 @@
11
[
2+
{
3+
"path": "llms.txt",
4+
"kind": "home output",
5+
"covers": [],
6+
"skip": false
7+
},
28
{
39
"path": "index.md",
410
"kind": "home",
5-
"covers": ["description", "body", "children"]
11+
"covers": ["description", "body", "children"],
12+
"skip": false
613
},
714
{
815
"path": "blog/index.md",
916
"kind": "section",
10-
"covers": ["!description", "!body", "children"]
17+
"covers": ["!description", "!body", "children"],
18+
"skip": false
1119
},
1220
{
1321
"path": "docs/index.md",
1422
"kind": "section",
15-
"covers": ["!description", "body", "children"]
23+
"covers": ["!description", "body", "children"],
24+
"skip": false
1625
},
1726
{
1827
"path": "docs/content/index.md",
1928
"kind": "section",
20-
"covers": ["description", "!body", "children"]
29+
"covers": ["description", "!body", "children"],
30+
"skip": false
2131
},
2232
{
2333
"path": "docs/get-started/index.md",
2434
"kind": "section",
25-
"covers": ["description", "body", "children"]
35+
"covers": ["description", "body", "children"],
36+
"skip": false
2637
},
2738
{
2839
"path": "blog/2022/hello/index.md",
2940
"kind": "page",
30-
"covers": ["description", "body", "!children"]
41+
"covers": ["description", "body", "!children"],
42+
"skip": false
3143
},
3244
{
3345
"path": "fr/index.md",
3446
"kind": "home",
35-
"covers": ["description", "body", "children", "i18n:fr"]
47+
"covers": ["description", "body", "children", "i18n:fr"],
48+
"skip": false
3649
}
3750
]

docsy.dev/tests/md-output/goldens/blog/2022/hello/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
55
---
66

7+
LLMS index: [llms.txt](/llms.txt)
8+
9+
---
10+
711
## Hello
812

913
It may seem strange to see a "Hello" post from a project that's several years

docsy.dev/tests/md-output/goldens/blog/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Blog
22

3+
LLMS index: [llms.txt](/llms.txt)
4+
5+
---
6+
37
Section pages:
48

59
- [Release 0.14.0 report and upgrade guide](/blog/2026/0.14.0/)

docsy.dev/tests/md-output/goldens/docs/content/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
55
---
66

7+
LLMS index: [llms.txt](/llms.txt)
8+
9+
---
10+
711
Section pages:
812

913
- [Adding Content](/docs/content/adding-content/): Add different types of content to your Docsy site.

0 commit comments

Comments
 (0)