@dogsbay/site-files 0.2.0-beta.151 → 0.2.0-beta.152
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/llms.js +6 -2
- package/package.json +1 -1
package/dist/llms.js
CHANGED
|
@@ -62,7 +62,7 @@ export function buildLlmsTxt(site, nav, pages, o) {
|
|
|
62
62
|
}
|
|
63
63
|
/** One top-level nav group's own llms.txt. */
|
|
64
64
|
export function buildSectionLlmsTxt(site, group, pages, o) {
|
|
65
|
-
const out = [`# ${site.name} — ${group.label}`, "", `## ${group.label}`, ""];
|
|
65
|
+
const out = [`# ${heading(site.name)} — ${heading(group.label)}`, "", `## ${heading(group.label)}`, ""];
|
|
66
66
|
pushEntry(out, group, pages, o);
|
|
67
67
|
collectEntries(group.children, pages, o, out);
|
|
68
68
|
return finish(out.join("\n"));
|
|
@@ -115,8 +115,12 @@ export function buildLlmsFullTxt(site, order, pages, url, load) {
|
|
|
115
115
|
}
|
|
116
116
|
return parts.join("") + "\n";
|
|
117
117
|
}
|
|
118
|
+
/** A name as one heading line: a line break in it would start lines of its own in the file. */
|
|
119
|
+
function heading(text) {
|
|
120
|
+
return text.replace(/[\r\n\u2028\u2029]+/g, " ").trim();
|
|
121
|
+
}
|
|
118
122
|
function header(site) {
|
|
119
|
-
const out = [`# ${site.name}`, ""];
|
|
123
|
+
const out = [`# ${heading(site.name)}`, ""];
|
|
120
124
|
if (site.description)
|
|
121
125
|
out.push(`> ${site.description}`, "");
|
|
122
126
|
if (site.whenToUse?.trim())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/site-files",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.152",
|
|
4
4
|
"description": "robots.txt, _headers, llms.txt, sitemaps, redirects and JSON-LD for docs sites; shared by the dogsbay Astro pipeline and dogsbay-ssg, Worker-safe",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|