@dogsbay/format-astro 0.2.0-beta.115 → 0.2.0-beta.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-markdown.d.ts +8 -0
- package/dist/api-markdown.d.ts.map +1 -0
- package/dist/api-markdown.js +41 -0
- package/dist/api-markdown.js.map +1 -0
- package/dist/blog.d.ts.map +1 -1
- package/dist/blog.js +5 -1
- package/dist/blog.js.map +1 -1
- package/dist/browser.d.ts +14 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +14 -0
- package/dist/browser.js.map +1 -0
- package/dist/canonical.d.ts +34 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +107 -0
- package/dist/canonical.js.map +1 -0
- package/dist/head-metadata.d.ts +26 -0
- package/dist/head-metadata.d.ts.map +1 -0
- package/dist/head-metadata.js +56 -0
- package/dist/head-metadata.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/lead.d.ts +1 -57
- package/dist/lead.d.ts.map +1 -1
- package/dist/lead.js +3 -132
- package/dist/lead.js.map +1 -1
- package/dist/llms-txt.d.ts +6 -10
- package/dist/llms-txt.d.ts.map +1 -1
- package/dist/llms-txt.js +48 -302
- package/dist/llms-txt.js.map +1 -1
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +3 -1
- package/dist/plugins.js.map +1 -1
- package/dist/project.d.ts +36 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +276 -841
- package/dist/project.js.map +1 -1
- package/dist/redirects.d.ts +22 -0
- package/dist/redirects.d.ts.map +1 -1
- package/dist/redirects.js +70 -123
- package/dist/redirects.js.map +1 -1
- package/dist/serialize.d.ts +4 -13
- package/dist/serialize.d.ts.map +1 -1
- package/dist/serialize.js +304 -102
- package/dist/serialize.js.map +1 -1
- package/dist/sitemap.d.ts +44 -17
- package/dist/sitemap.d.ts.map +1 -1
- package/dist/sitemap.js +31 -104
- package/dist/sitemap.js.map +1 -1
- package/dist/taxonomy.d.ts.map +1 -1
- package/dist/taxonomy.js +7 -1
- package/dist/taxonomy.js.map +1 -1
- package/dist/theme-css.d.ts +26 -0
- package/dist/theme-css.d.ts.map +1 -0
- package/dist/theme-css.js +642 -0
- package/dist/theme-css.js.map +1 -0
- package/dist/tone-classes.d.ts +14 -0
- package/dist/tone-classes.d.ts.map +1 -0
- package/dist/tone-classes.js +30 -0
- package/dist/tone-classes.js.map +1 -0
- package/dist/write-if-changed.d.ts +21 -0
- package/dist/write-if-changed.d.ts.map +1 -0
- package/dist/write-if-changed.js +58 -0
- package/dist/write-if-changed.js.map +1 -0
- package/package.json +13 -5
package/dist/lead.js
CHANGED
|
@@ -1,133 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Defensive against empty trees and missing properties — returns
|
|
5
|
-
* `false` for both flags when the tree is empty.
|
|
6
|
-
*/
|
|
7
|
-
export function detectLeadingNodes(tree) {
|
|
8
|
-
if (!tree || tree.length === 0) {
|
|
9
|
-
return { hasH1: false, hasLede: false };
|
|
10
|
-
}
|
|
11
|
-
// H1 detection looks past two things that are not content:
|
|
12
|
-
//
|
|
13
|
-
// - leading raw-HTML CHROME (banners, toolbars — the comparison view
|
|
14
|
-
// injects both). Only tree[0] was inspected before, so a page that
|
|
15
|
-
// opened with a banner "had no H1" and the layout added a second
|
|
16
|
-
// one (external review);
|
|
17
|
-
// - a transparent `group` wrapper, which by definition adds no
|
|
18
|
-
// semantics — it exists only to carry an attribute for a run of
|
|
19
|
-
// blocks (the comparison marks a whole added/removed page with one).
|
|
20
|
-
// A wrapper that hid the page's H1 would resurrect the same bug.
|
|
21
|
-
//
|
|
22
|
-
// LEDE detection deliberately still keys off tree[0]: a paragraph that
|
|
23
|
-
// merely follows an HTML block is not the page's lede, and treating it
|
|
24
|
-
// as one silently suppresses the frontmatter description on any
|
|
25
|
-
// imported page opening with a <figure>/hero block (code review,
|
|
26
|
-
// 2026-07-13). Only an H1 introduces a lede.
|
|
27
|
-
let list = tree;
|
|
28
|
-
for (;;) {
|
|
29
|
-
let i = 0;
|
|
30
|
-
while (i < list.length && list[i]?.type === "html")
|
|
31
|
-
i++;
|
|
32
|
-
const first = list[i];
|
|
33
|
-
if (first?.type === "group" && first.children?.length) {
|
|
34
|
-
list = first.children;
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
if (isH1(first)) {
|
|
38
|
-
return { hasH1: true, hasLede: isParagraph(list[i + 1]) };
|
|
39
|
-
}
|
|
40
|
-
return { hasH1: false, hasLede: isParagraph(tree[0]) };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function isH1(node) {
|
|
44
|
-
if (!node || node.type !== "heading")
|
|
45
|
-
return false;
|
|
46
|
-
// Some importers (dogsbay-md, mkdocs) attach depth as a top-level
|
|
47
|
-
// field; others (Starlight via mdx-jsx) use props.level. Both
|
|
48
|
-
// conventions are valid — check both.
|
|
49
|
-
const depth = node.depth;
|
|
50
|
-
if (typeof depth === "number")
|
|
51
|
-
return depth === 1;
|
|
52
|
-
const level = node.props?.level;
|
|
53
|
-
if (typeof level === "number")
|
|
54
|
-
return level === 1;
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
function isParagraph(node) {
|
|
58
|
-
if (!node)
|
|
59
|
-
return false;
|
|
60
|
-
return node.type === "paragraph";
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Derive a `<meta name="description">` from a page body when the
|
|
64
|
-
* frontmatter doesn't supply one: the first prose paragraph,
|
|
65
|
-
* whitespace-collapsed and truncated at a word boundary.
|
|
66
|
-
*
|
|
67
|
-
* Deliberately Minja-unaware. This only runs at build time, on the
|
|
68
|
-
* preprocessed (resolved) tree — `{{ var }}` and `{% include %}` are
|
|
69
|
-
* already gone, so the first paragraph is real prose. (A still-undefined
|
|
70
|
-
* `{{ var }}` survives `preserve` mode, but that's a content bug equally
|
|
71
|
-
* visible in the body and already flagged by the `unresolved-directives`
|
|
72
|
-
* audit — not the description's job to scrub.) The `--no-preprocess` /
|
|
73
|
-
* `dogsbay convert` paths emit unresolved output by design, where a
|
|
74
|
-
* slightly-off description is the least of it.
|
|
75
|
-
*
|
|
76
|
-
* Scans past a leading H1 / heading / code to the first prose paragraph;
|
|
77
|
-
* returns `undefined` when the page has no prose. See
|
|
78
|
-
* plans/auto-meta-description.md.
|
|
79
|
-
*/
|
|
80
|
-
export function deriveDescription(tree, maxLen = 155) {
|
|
81
|
-
if (!tree || tree.length === 0)
|
|
82
|
-
return undefined;
|
|
83
|
-
// Skip a leading H1 (the page title) so the lede is the node after it.
|
|
84
|
-
let i = isH1(tree[0]) ? 1 : 0;
|
|
85
|
-
for (; i < tree.length; i++) {
|
|
86
|
-
const node = tree[i];
|
|
87
|
-
if (node.type !== "paragraph")
|
|
88
|
-
continue; // skip headings/code/etc.
|
|
89
|
-
const text = paragraphText(node).replace(/\s+/g, " ").trim();
|
|
90
|
-
if (!text)
|
|
91
|
-
continue;
|
|
92
|
-
return truncateAtWord(text, maxLen);
|
|
93
|
-
}
|
|
94
|
-
return undefined;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Flatten a paragraph node's text. Tolerant of the three shapes
|
|
98
|
-
* format-astro already handles: flat `node.inline`, wrapped
|
|
99
|
-
* `node.children[{ inline }]`, and pre-rendered `node.html`.
|
|
100
|
-
*/
|
|
101
|
-
function paragraphText(node) {
|
|
102
|
-
const parts = [];
|
|
103
|
-
const visit = (n) => {
|
|
104
|
-
if (!n || typeof n !== "object")
|
|
105
|
-
return;
|
|
106
|
-
const o = n;
|
|
107
|
-
if (typeof o.text === "string")
|
|
108
|
-
parts.push(o.text);
|
|
109
|
-
if (typeof o.code === "string")
|
|
110
|
-
parts.push(o.code);
|
|
111
|
-
if (Array.isArray(o.inline))
|
|
112
|
-
o.inline.forEach(visit);
|
|
113
|
-
if (Array.isArray(o.children))
|
|
114
|
-
o.children.forEach(visit);
|
|
115
|
-
};
|
|
116
|
-
if (Array.isArray(node.inline))
|
|
117
|
-
node.inline.forEach(visit);
|
|
118
|
-
else if (Array.isArray(node.children))
|
|
119
|
-
node.children.forEach(visit);
|
|
120
|
-
else if (typeof node.html === "string") {
|
|
121
|
-
parts.push(node.html.replace(/<[^>]+>/g, ""));
|
|
122
|
-
}
|
|
123
|
-
return parts.join("");
|
|
124
|
-
}
|
|
125
|
-
function truncateAtWord(s, max) {
|
|
126
|
-
if (s.length <= max)
|
|
127
|
-
return s;
|
|
128
|
-
const cut = s.slice(0, max);
|
|
129
|
-
const lastSpace = cut.lastIndexOf(" ");
|
|
130
|
-
const base = lastSpace > max * 0.6 ? cut.slice(0, lastSpace) : cut;
|
|
131
|
-
return base.replace(/[\s.,;:!?-]+$/, "") + "…";
|
|
132
|
-
}
|
|
1
|
+
// Moved to @dogsbay/serialize-core (src/lead.ts), so @dogsbay/site-check can use
|
|
2
|
+
// these without depending on format-astro, which brings @dogsbay/ui and astro.
|
|
3
|
+
export { detectLeadingNodes, deriveDescription } from "@dogsbay/serialize-core";
|
|
133
4
|
//# sourceMappingURL=lead.js.map
|
package/dist/lead.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lead.js","sourceRoot":"","sources":["../src/lead.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lead.js","sourceRoot":"","sources":["../src/lead.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAC/E,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAwB,MAAM,yBAAyB,CAAC"}
|
package/dist/llms-txt.d.ts
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* dependency-free (only @dogsbay/types). Callers wire the actual
|
|
15
15
|
* `treeToDogsbayMd` serializer when they want full-body bundles.
|
|
16
16
|
*/
|
|
17
|
-
import type { ExportPage, NavItem, SiteConfig
|
|
17
|
+
import type { ExportPage, NavItem, SiteConfig } from "@dogsbay/types";
|
|
18
|
+
import { extractFirstParagraph } from "@dogsbay/serialize-core";
|
|
19
|
+
export { extractFirstParagraph };
|
|
18
20
|
export interface BuildLlmsTxtOptions {
|
|
19
21
|
/**
|
|
20
22
|
* Used to derive page slugs from nav hrefs. Defaults to
|
|
@@ -103,7 +105,7 @@ export interface BuildLlmsFullTxtOptions extends BuildLlmsTxtOptions {
|
|
|
103
105
|
* - Pages reachable in `pages` but absent from `nav` appended under
|
|
104
106
|
* a final `## {otherPagesLabel}` section. Set `otherPagesLabel`
|
|
105
107
|
* to `false` to suppress (e.g. when nav is the publish list).
|
|
106
|
-
* - External hrefs are skipped.
|
|
108
|
+
* - External hrefs, and hrefs outside `hrefPrefix`, are skipped.
|
|
107
109
|
*/
|
|
108
110
|
export declare function buildLlmsTxt(siteConfig: Pick<SiteConfig, "siteName" | "description" | "siteUrl">, nav: NavItem[], pages: ExportPage[], options?: BuildLlmsTxtOptions): string;
|
|
109
111
|
/**
|
|
@@ -113,15 +115,9 @@ export declare function buildLlmsTxt(siteConfig: Pick<SiteConfig, "siteName" | "
|
|
|
113
115
|
*/
|
|
114
116
|
export declare function buildSectionLlmsTxt(siteConfig: Pick<SiteConfig, "siteName" | "siteUrl">, group: NavItem, pages: ExportPage[], options?: BuildLlmsTxtOptions): string;
|
|
115
117
|
/**
|
|
116
|
-
* Bundle every page
|
|
117
|
-
* nav
|
|
118
|
+
* Bundle every page into a single document: nav order, then pages outside
|
|
119
|
+
* the nav by slug. Each page is delimited by a `# Title` header and `URL:`
|
|
118
120
|
* line, then either the full body (default) or just a description.
|
|
119
121
|
*/
|
|
120
122
|
export declare function buildLlmsFullTxt(siteConfig: Pick<SiteConfig, "siteName" | "description" | "siteUrl">, nav: NavItem[], pages: ExportPage[], options?: BuildLlmsFullTxtOptions): string;
|
|
121
|
-
/**
|
|
122
|
-
* Extract plain text of the first paragraph in a page tree. Cross-shape
|
|
123
|
-
* tolerant: handles `node.inline` (dogsbay-md parser) and
|
|
124
|
-
* `node.children[{type: "prose", inline}]` (Starlight importer).
|
|
125
|
-
*/
|
|
126
|
-
export declare function extractFirstParagraph(tree: TreeNode[]): string;
|
|
127
123
|
//# sourceMappingURL=llms-txt.d.ts.map
|
package/dist/llms-txt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms-txt.d.ts","sourceRoot":"","sources":["../src/llms-txt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"llms-txt.d.ts","sourceRoot":"","sources":["../src/llms-txt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,UAAU,EAEX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAchE,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAOjC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;CAC9C;AASD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC,EACpE,GAAG,EAAE,OAAO,EAAE,EACd,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAeR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,EACpD,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAGR;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC,EACpE,GAAG,EAAE,OAAO,EAAE,EACd,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAqBR"}
|
package/dist/llms-txt.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { extractFirstParagraph } from "@dogsbay/serialize-core";
|
|
1
2
|
import { DEFAULT_BASE_PATH } from "./base-path.js";
|
|
3
|
+
import { DESCRIPTION_LIMIT, buildLlmsFullTxt as buildLlmsFullTxtFile, buildLlmsTxt as buildLlmsTxtFile, buildSectionLlmsTxt as buildSectionLlmsTxtFile, llmsFullOrder, truncate, } from "@dogsbay/site-files";
|
|
4
|
+
// Moved to serialize-core so @dogsbay/site-check need not depend on format-astro
|
|
5
|
+
export { extractFirstParagraph };
|
|
2
6
|
const EXTERNAL_HREF_RE = /^(?:https?:\/\/|mailto:|tel:|#)/i;
|
|
3
|
-
const DEFAULT_DESCRIPTION_LIMIT =
|
|
4
|
-
const DEFAULT_TOP_LEVEL_LABEL = "Documentation";
|
|
5
|
-
const DEFAULT_OTHER_PAGES_LABEL = "Other pages";
|
|
6
|
-
const DEFAULT_AGGREGATES_LABEL = "Other sites";
|
|
7
|
+
const DEFAULT_DESCRIPTION_LIMIT = DESCRIPTION_LIMIT;
|
|
7
8
|
// ── Public builders ─────────────────────────────────────────────
|
|
9
|
+
//
|
|
10
|
+
// The files themselves are written by @dogsbay/site-files, shared with
|
|
11
|
+
// dogsbay-ssg. This module maps ExportPage and NavItem onto its records:
|
|
12
|
+
// keys are slugs ("index" for the home page), URLs are `<prefix>/<slug>.md`,
|
|
13
|
+
// descriptions come from front matter or the first paragraph.
|
|
8
14
|
/**
|
|
9
15
|
* Build the top-level llms.txt index for a site.
|
|
10
16
|
*
|
|
@@ -15,95 +21,18 @@ const DEFAULT_AGGREGATES_LABEL = "Other sites";
|
|
|
15
21
|
* - Pages reachable in `pages` but absent from `nav` appended under
|
|
16
22
|
* a final `## {otherPagesLabel}` section. Set `otherPagesLabel`
|
|
17
23
|
* to `false` to suppress (e.g. when nav is the publish list).
|
|
18
|
-
* - External hrefs are skipped.
|
|
24
|
+
* - External hrefs, and hrefs outside `hrefPrefix`, are skipped.
|
|
19
25
|
*/
|
|
20
26
|
export function buildLlmsTxt(siteConfig, nav, pages, options = {}) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
: options.otherPagesLabel
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const out = [];
|
|
31
|
-
out.push(`# ${siteConfig.siteName}`);
|
|
32
|
-
out.push("");
|
|
33
|
-
if (siteConfig.description) {
|
|
34
|
-
out.push(`> ${siteConfig.description}`);
|
|
35
|
-
out.push("");
|
|
36
|
-
}
|
|
37
|
-
if (options.whenToUse?.trim()) {
|
|
38
|
-
out.push("## When to use this");
|
|
39
|
-
out.push("");
|
|
40
|
-
out.push(options.whenToUse.trim());
|
|
41
|
-
out.push("");
|
|
42
|
-
}
|
|
43
|
-
const topLevelLeaves = [];
|
|
44
|
-
const groupSections = [];
|
|
45
|
-
for (const item of nav) {
|
|
46
|
-
if (item.children && item.children.length > 0) {
|
|
47
|
-
const lines = [];
|
|
48
|
-
lines.push(`## ${item.label}`);
|
|
49
|
-
lines.push("");
|
|
50
|
-
// Group's own landing page first, if it has one
|
|
51
|
-
if (item.href && !EXTERNAL_HREF_RE.test(item.href)) {
|
|
52
|
-
const entry = renderEntry(item, slugIndex, hrefPrefix, siteUrl, descLimit, emittedSlugs);
|
|
53
|
-
if (entry)
|
|
54
|
-
lines.push(entry);
|
|
55
|
-
}
|
|
56
|
-
collectEntries(item.children, slugIndex, hrefPrefix, siteUrl, descLimit, lines, emittedSlugs);
|
|
57
|
-
lines.push("");
|
|
58
|
-
groupSections.push(lines);
|
|
59
|
-
}
|
|
60
|
-
else if (item.href && !EXTERNAL_HREF_RE.test(item.href)) {
|
|
61
|
-
topLevelLeaves.push(item);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (topLevelLeaves.length > 0) {
|
|
65
|
-
out.push(`## ${topLevelLabel}`);
|
|
66
|
-
out.push("");
|
|
67
|
-
for (const leaf of topLevelLeaves) {
|
|
68
|
-
const entry = renderEntry(leaf, slugIndex, hrefPrefix, siteUrl, descLimit, emittedSlugs);
|
|
69
|
-
if (entry)
|
|
70
|
-
out.push(entry);
|
|
71
|
-
}
|
|
72
|
-
out.push("");
|
|
73
|
-
}
|
|
74
|
-
for (const section of groupSections) {
|
|
75
|
-
out.push(...section);
|
|
76
|
-
}
|
|
77
|
-
// Orphan pass — pages that exist in `pages` but were never hit by
|
|
78
|
-
// the nav walk. Emit so agents see the full surface even when nav
|
|
79
|
-
// curates a subset (the common case: a sidebar trims internal /
|
|
80
|
-
// sub-utility pages, but agents still want to find them).
|
|
81
|
-
if (otherPagesLabel !== false) {
|
|
82
|
-
const orphans = collectOrphanEntries(pages, emittedSlugs, hrefPrefix, siteUrl, descLimit);
|
|
83
|
-
if (orphans.length > 0) {
|
|
84
|
-
out.push(`## ${otherPagesLabel}`);
|
|
85
|
-
out.push("");
|
|
86
|
-
out.push(...orphans);
|
|
87
|
-
out.push("");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
// Aggregated sites last: this site's own content comes first for an
|
|
91
|
-
// agent reading top-down with a budget.
|
|
92
|
-
const aggregates = (options.aggregates ?? []).filter((a) => a.llmsTxt || a.url);
|
|
93
|
-
if (aggregates.length > 0) {
|
|
94
|
-
out.push(`## ${options.aggregatesLabel ?? DEFAULT_AGGREGATES_LABEL}`);
|
|
95
|
-
out.push("");
|
|
96
|
-
for (const a of aggregates) {
|
|
97
|
-
// Prefer the llms.txt: it is the agent-shaped entry point. Fall
|
|
98
|
-
// back to the site root so a partially-configured entry still
|
|
99
|
-
// yields a working link rather than being silently dropped.
|
|
100
|
-
const href = a.llmsTxt ?? a.url;
|
|
101
|
-
const desc = a.description ? `: ${a.description}` : "";
|
|
102
|
-
out.push(`- [${a.name}](${href})${desc}`);
|
|
103
|
-
}
|
|
104
|
-
out.push("");
|
|
105
|
-
}
|
|
106
|
-
return out.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd() + "\n";
|
|
27
|
+
const m = mapInputs(siteConfig, nav, pages, options);
|
|
28
|
+
return buildLlmsTxtFile({ name: siteConfig.siteName, description: siteConfig.description, whenToUse: options.whenToUse, aggregates: options.aggregates }, m.nav, m.pages, {
|
|
29
|
+
url: m.url,
|
|
30
|
+
// A nav entry whose page is missing is still linked, by its label.
|
|
31
|
+
missing: "link",
|
|
32
|
+
topLevelLabel: options.topLevelLabel,
|
|
33
|
+
otherPagesLabel: options.otherPagesLabel,
|
|
34
|
+
aggregatesLabel: options.aggregatesLabel,
|
|
35
|
+
});
|
|
107
36
|
}
|
|
108
37
|
/**
|
|
109
38
|
* Per-section llms.txt — same shape as the root index, scoped to one
|
|
@@ -111,158 +40,44 @@ export function buildLlmsTxt(siteConfig, nav, pages, options = {}) {
|
|
|
111
40
|
* can pull only the section they care about.
|
|
112
41
|
*/
|
|
113
42
|
export function buildSectionLlmsTxt(siteConfig, group, pages, options = {}) {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const descLimit = options.descriptionLimit ?? DEFAULT_DESCRIPTION_LIMIT;
|
|
117
|
-
const slugIndex = indexPagesBySlug(pages);
|
|
118
|
-
const out = [];
|
|
119
|
-
out.push(`# ${siteConfig.siteName} — ${group.label}`);
|
|
120
|
-
out.push("");
|
|
121
|
-
out.push(`## ${group.label}`);
|
|
122
|
-
out.push("");
|
|
123
|
-
if (group.href && !EXTERNAL_HREF_RE.test(group.href)) {
|
|
124
|
-
const entry = renderEntry(group, slugIndex, hrefPrefix, siteUrl, descLimit);
|
|
125
|
-
if (entry)
|
|
126
|
-
out.push(entry);
|
|
127
|
-
}
|
|
128
|
-
if (group.children) {
|
|
129
|
-
collectEntries(group.children, slugIndex, hrefPrefix, siteUrl, descLimit, out);
|
|
130
|
-
}
|
|
131
|
-
return out.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd() + "\n";
|
|
43
|
+
const m = mapInputs(siteConfig, [group], pages, options);
|
|
44
|
+
return buildSectionLlmsTxtFile({ name: siteConfig.siteName }, m.nav[0], m.pages, { url: m.url, missing: "link" });
|
|
132
45
|
}
|
|
133
46
|
/**
|
|
134
|
-
* Bundle every page
|
|
135
|
-
* nav
|
|
47
|
+
* Bundle every page into a single document: nav order, then pages outside
|
|
48
|
+
* the nav by slug. Each page is delimited by a `# Title` header and `URL:`
|
|
136
49
|
* line, then either the full body (default) or just a description.
|
|
137
50
|
*/
|
|
138
51
|
export function buildLlmsFullTxt(siteConfig, nav, pages, options = {}) {
|
|
139
|
-
const hrefPrefix = options.hrefPrefix ?? DEFAULT_BASE_PATH;
|
|
140
|
-
const siteUrl = options.siteUrl ?? siteConfig.siteUrl;
|
|
141
52
|
const summary = options.summary ?? (options.serializePage ? "body" : "description");
|
|
142
53
|
if (summary === "body" && !options.serializePage) {
|
|
143
54
|
throw new Error(`buildLlmsFullTxt: summary "body" requires options.serializePage`);
|
|
144
55
|
}
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const seen = new Set(navOrder);
|
|
152
|
-
const orphanSlugs = pages
|
|
153
|
-
.map((p) => p.slug || "index")
|
|
154
|
-
.filter((s) => !seen.has(s))
|
|
155
|
-
.sort((a, b) => a.localeCompare(b));
|
|
156
|
-
const allSlugs = [...navOrder, ...orphanSlugs];
|
|
157
|
-
const out = [];
|
|
158
|
-
out.push(`# ${siteConfig.siteName}`);
|
|
159
|
-
out.push("");
|
|
160
|
-
if (siteConfig.description) {
|
|
161
|
-
out.push(`> ${siteConfig.description}`);
|
|
162
|
-
out.push("");
|
|
163
|
-
}
|
|
164
|
-
if (options.whenToUse?.trim()) {
|
|
165
|
-
out.push("## When to use this");
|
|
166
|
-
out.push("");
|
|
167
|
-
out.push(options.whenToUse.trim());
|
|
168
|
-
out.push("");
|
|
169
|
-
}
|
|
170
|
-
let firstPage = true;
|
|
171
|
-
for (const slug of allSlugs) {
|
|
172
|
-
const page = slugIndex.get(slug);
|
|
173
|
-
if (!page)
|
|
174
|
-
continue;
|
|
175
|
-
if (!firstPage) {
|
|
176
|
-
out.push("---");
|
|
177
|
-
out.push("");
|
|
178
|
-
}
|
|
179
|
-
firstPage = false;
|
|
180
|
-
out.push(`# ${page.title}`);
|
|
181
|
-
out.push("");
|
|
182
|
-
out.push(`URL: ${absoluteUrl(slugToHref(slug, hrefPrefix), siteUrl)}`);
|
|
183
|
-
out.push("");
|
|
184
|
-
if (summary === "body") {
|
|
185
|
-
out.push(options.serializePage(page).trimEnd());
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
const desc = getPageDescription(page, options.descriptionLimit ?? DEFAULT_DESCRIPTION_LIMIT);
|
|
189
|
-
out.push(desc || page.title);
|
|
190
|
-
}
|
|
191
|
-
out.push("");
|
|
192
|
-
}
|
|
193
|
-
return out.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd() + "\n";
|
|
194
|
-
}
|
|
195
|
-
// ── Internals: nav walking + entry rendering ────────────────────
|
|
196
|
-
function collectEntries(items, slugIndex, hrefPrefix, siteUrl, descLimit, out, emitted) {
|
|
197
|
-
for (const item of items) {
|
|
198
|
-
if (item.href && !EXTERNAL_HREF_RE.test(item.href)) {
|
|
199
|
-
const entry = renderEntry(item, slugIndex, hrefPrefix, siteUrl, descLimit, emitted);
|
|
200
|
-
if (entry)
|
|
201
|
-
out.push(entry);
|
|
202
|
-
}
|
|
203
|
-
if (item.children) {
|
|
204
|
-
collectEntries(item.children, slugIndex, hrefPrefix, siteUrl, descLimit, out, emitted);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function renderEntry(item, slugIndex, hrefPrefix, siteUrl, descLimit, emitted) {
|
|
209
|
-
if (!item.href)
|
|
210
|
-
return null;
|
|
211
|
-
const slug = hrefToSlug(item.href, hrefPrefix);
|
|
212
|
-
if (slug === null)
|
|
213
|
-
return null;
|
|
214
|
-
const page = slugIndex.get(slug);
|
|
215
|
-
const label = item.label || page?.title || slug;
|
|
216
|
-
const description = page ? getPageDescription(page, descLimit) : "";
|
|
217
|
-
// Same host-root degeneration as slugToHref: href "/" strips to ""
|
|
218
|
-
// and would yield ".md".
|
|
219
|
-
const stripped = item.href.replace(/\/$/, "");
|
|
220
|
-
const url = absoluteUrl(stripped ? `${stripped}.md` : indexMirrorHref(""), siteUrl);
|
|
221
|
-
if (emitted && page)
|
|
222
|
-
emitted.add(slug);
|
|
223
|
-
return description
|
|
224
|
-
? `- [${label}](${url}): ${description}`
|
|
225
|
-
: `- [${label}](${url})`;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Render entries for pages that exist but weren't reached during the
|
|
229
|
-
* nav walk. Sorted alphabetically by slug for stable output (nav
|
|
230
|
-
* order isn't meaningful for these — they're not in nav).
|
|
231
|
-
*/
|
|
232
|
-
function collectOrphanEntries(pages, emitted, hrefPrefix, siteUrl, descLimit) {
|
|
233
|
-
const orphans = [];
|
|
234
|
-
const sorted = pages
|
|
235
|
-
.filter((p) => !emitted.has(p.slug || "index"))
|
|
236
|
-
.sort((a, b) => (a.slug || "index").localeCompare(b.slug || "index"));
|
|
237
|
-
for (const page of sorted) {
|
|
238
|
-
const slug = page.slug || "index";
|
|
239
|
-
const label = page.title || slug;
|
|
240
|
-
const description = getPageDescription(page, descLimit);
|
|
241
|
-
const url = absoluteUrl(slugToHref(slug, hrefPrefix), siteUrl);
|
|
242
|
-
orphans.push(description
|
|
243
|
-
? `- [${label}](${url}): ${description}`
|
|
244
|
-
: `- [${label}](${url})`);
|
|
245
|
-
}
|
|
246
|
-
return orphans;
|
|
247
|
-
}
|
|
248
|
-
function flattenNavToSlugs(nav, hrefPrefix) {
|
|
249
|
-
const slugs = [];
|
|
250
|
-
const seen = new Set();
|
|
251
|
-
const walk = (items) => {
|
|
252
|
-
for (const item of items) {
|
|
253
|
-
if (item.href && !EXTERNAL_HREF_RE.test(item.href)) {
|
|
254
|
-
const slug = hrefToSlug(item.href, hrefPrefix);
|
|
255
|
-
if (slug !== null && !seen.has(slug)) {
|
|
256
|
-
seen.add(slug);
|
|
257
|
-
slugs.push(slug);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
if (item.children)
|
|
261
|
-
walk(item.children);
|
|
262
|
-
}
|
|
56
|
+
const m = mapInputs(siteConfig, nav, pages, options);
|
|
57
|
+
const load = (key) => {
|
|
58
|
+
const page = m.byKey.get(key);
|
|
59
|
+
if (summary === "body")
|
|
60
|
+
return options.serializePage(page);
|
|
61
|
+
return m.pages.get(key).description || page.title;
|
|
263
62
|
};
|
|
264
|
-
|
|
265
|
-
|
|
63
|
+
return buildLlmsFullTxtFile({ name: siteConfig.siteName, description: siteConfig.description, whenToUse: options.whenToUse }, llmsFullOrder(m.nav, m.pages), m.pages, m.url, load);
|
|
64
|
+
}
|
|
65
|
+
/** ExportPage and NavItem as @dogsbay/site-files records. */
|
|
66
|
+
function mapInputs(siteConfig, nav, pages, options) {
|
|
67
|
+
const hrefPrefix = options.hrefPrefix ?? DEFAULT_BASE_PATH;
|
|
68
|
+
const siteUrl = options.siteUrl ?? siteConfig.siteUrl;
|
|
69
|
+
const limit = options.descriptionLimit ?? DEFAULT_DESCRIPTION_LIMIT;
|
|
70
|
+
const byKey = indexPagesBySlug(pages);
|
|
71
|
+
const records = new Map();
|
|
72
|
+
for (const [key, page] of byKey) {
|
|
73
|
+
const description = getPageDescription(page, limit);
|
|
74
|
+
records.set(key, { title: page.title, ...(description ? { description } : {}) });
|
|
75
|
+
}
|
|
76
|
+
const toNav = (items) => items.map((item) => {
|
|
77
|
+
const key = item.href ? hrefToSlug(item.href, hrefPrefix) : null;
|
|
78
|
+
return { label: item.label, ...(key !== null ? { key } : {}), children: toNav(item.children ?? []) };
|
|
79
|
+
});
|
|
80
|
+
return { pages: records, byKey, nav: toNav(nav), url: (key) => absoluteUrl(slugToHref(key, hrefPrefix), siteUrl) };
|
|
266
81
|
}
|
|
267
82
|
// ── Internals: page lookup + URL math ───────────────────────────
|
|
268
83
|
function indexPagesBySlug(pages) {
|
|
@@ -333,73 +148,4 @@ function getPageDescription(page, limit) {
|
|
|
333
148
|
const firstPara = extractFirstParagraph(page.tree);
|
|
334
149
|
return firstPara ? truncate(firstPara, limit) : "";
|
|
335
150
|
}
|
|
336
|
-
/**
|
|
337
|
-
* Extract plain text of the first paragraph in a page tree. Cross-shape
|
|
338
|
-
* tolerant: handles `node.inline` (dogsbay-md parser) and
|
|
339
|
-
* `node.children[{type: "prose", inline}]` (Starlight importer).
|
|
340
|
-
*/
|
|
341
|
-
export function extractFirstParagraph(tree) {
|
|
342
|
-
for (const node of tree) {
|
|
343
|
-
if (node.type !== "paragraph")
|
|
344
|
-
continue;
|
|
345
|
-
const inline = node.inline ?? findProseInline(node.children);
|
|
346
|
-
if (inline)
|
|
347
|
-
return inlineToPlainText(inline).trim();
|
|
348
|
-
}
|
|
349
|
-
return "";
|
|
350
|
-
}
|
|
351
|
-
function findProseInline(children) {
|
|
352
|
-
if (!children)
|
|
353
|
-
return undefined;
|
|
354
|
-
for (const child of children) {
|
|
355
|
-
if (child.type === "prose" && child.inline)
|
|
356
|
-
return child.inline;
|
|
357
|
-
}
|
|
358
|
-
return undefined;
|
|
359
|
-
}
|
|
360
|
-
function inlineToPlainText(inline) {
|
|
361
|
-
let out = "";
|
|
362
|
-
for (const node of inline) {
|
|
363
|
-
switch (node.type) {
|
|
364
|
-
case "text":
|
|
365
|
-
out += node.text;
|
|
366
|
-
break;
|
|
367
|
-
case "code":
|
|
368
|
-
out += node.text;
|
|
369
|
-
break;
|
|
370
|
-
case "link":
|
|
371
|
-
case "highlight":
|
|
372
|
-
out += inlineToPlainText(node.children);
|
|
373
|
-
break;
|
|
374
|
-
case "kbd":
|
|
375
|
-
out += node.keys.join("+");
|
|
376
|
-
break;
|
|
377
|
-
case "math":
|
|
378
|
-
out += node.latex;
|
|
379
|
-
break;
|
|
380
|
-
case "image":
|
|
381
|
-
if (node.alt)
|
|
382
|
-
out += node.alt;
|
|
383
|
-
break;
|
|
384
|
-
case "break":
|
|
385
|
-
out += " ";
|
|
386
|
-
break;
|
|
387
|
-
case "html-inline":
|
|
388
|
-
case "footnote-ref":
|
|
389
|
-
case "icon":
|
|
390
|
-
// No useful plain text; skip.
|
|
391
|
-
break;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
return out;
|
|
395
|
-
}
|
|
396
|
-
function truncate(text, limit) {
|
|
397
|
-
const collapsed = text.replace(/\s+/g, " ").trim();
|
|
398
|
-
if (collapsed.length <= limit)
|
|
399
|
-
return collapsed;
|
|
400
|
-
const slice = collapsed.slice(0, limit);
|
|
401
|
-
const lastSpace = slice.lastIndexOf(" ");
|
|
402
|
-
const cut = lastSpace > limit * 0.5 ? slice.slice(0, lastSpace) : slice;
|
|
403
|
-
return `${cut.trimEnd()}…`;
|
|
404
|
-
}
|
|
405
151
|
//# sourceMappingURL=llms-txt.js.map
|
package/dist/llms-txt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms-txt.js","sourceRoot":"","sources":["../src/llms-txt.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAC5D,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAChD,MAAM,yBAAyB,GAAG,aAAa,CAAC;AAChD,MAAM,wBAAwB,GAAG,aAAa,CAAC;AAqF/C,mEAAmE;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,UAAoE,EACpE,GAAc,EACd,KAAmB,EACnB,UAA+B,EAAE;IAEjC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,iBAAiB,CAAC;IAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC;IACtD,MAAM,SAAS,GAAG,OAAO,CAAC,gBAAgB,IAAI,yBAAyB,CAAC;IACxE,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,uBAAuB,CAAC;IACvE,MAAM,eAAe,GACnB,OAAO,CAAC,eAAe,KAAK,SAAS;QACnC,CAAC,CAAC,yBAAyB;QAC3B,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IAE9B,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACvC,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tC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;AACzE,CAAC;AAED,mEAAmE;AAEnE,SAAS,kBAAkB,CAAC,IAAgB,EAAE,KAAa;IACzD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,CAAC;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,SAAS,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrD,CAAC"}
|
package/dist/plugins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AA4CA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,aAAa,EAAE,wBAAwB,EAAE,CAAC;IAC1C,6CAA6C;IAC7C,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,wCAAwC;IACxC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC1C;AAsBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAMzE;AA4RD,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAM3D"}
|
package/dist/plugins.js
CHANGED
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
*
|
|
38
38
|
* See plans/plugin-api.md.
|
|
39
39
|
*/
|
|
40
|
-
import {
|
|
40
|
+
import { readFileSync, existsSync, mkdirSync, rmSync } from "node:fs";
|
|
41
|
+
// Unchanged files are not rewritten, so `site dev` reloads only what changed
|
|
42
|
+
import { writeFileSync, copyFileSync } from "./write-if-changed.js";
|
|
41
43
|
import { dirname, join, basename, extname } from "node:path";
|
|
42
44
|
/**
|
|
43
45
|
* Slots the runtime emits stack files for. Each entry is always
|