ssqch 0.11.0 → 0.13.0
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/bundled/completions/bash +67 -9
- package/bundled/completions/elvish +24 -4
- package/bundled/completions/fish +37 -25
- package/bundled/completions/powershell +26 -4
- package/bundled/completions/zsh +45 -10
- package/bundled/docs/agents.md +2 -2
- package/bundled/docs/build-summary.md +1 -1
- package/bundled/docs/comparing-builds.md +7 -4
- package/bundled/docs/configuring.md +7 -12
- package/bundled/docs/deploying.md +1 -1
- package/bundled/docs/field-guide.md +4 -4
- package/bundled/docs/github-pages.md +2 -1
- package/bundled/docs/index.md +1 -1
- package/bundled/docs/install.md +1 -1
- package/bundled/docs/known-gaps.md +1 -1
- package/bundled/docs/markdown.md +11 -13
- package/bundled/docs/nav.yml +6 -1
- package/bundled/docs/netlify.md +4 -2
- package/bundled/docs/patrol.md +48 -0
- package/bundled/docs/plugins.md +6 -4
- package/bundled/docs/robots.md +72 -0
- package/bundled/docs/seo.md +2 -38
- package/bundled/docs/serving-markdown.md +142 -0
- package/bundled/docs/template-languages.md +2 -1
- package/bundled/docs/templates.md +2 -1
- package/bundled/docs/trailheads/from-component-frameworks.md +9 -10
- package/bundled/docs/trailheads/from-hugo.md +5 -3
- package/bundled/docs/trailheads/from-jekyll.md +54 -13
- package/bundled/docs/trailheads/from-mkdocs.md +15 -12
- package/bundled/docs/trailheads/from-vitepress.md +142 -0
- package/bundled/docs/trailheads.md +5 -5
- package/bundled/docs/where-values-come-from.md +5 -5
- package/bundled/docs/writing-plugins.md +69 -0
- package/bundled/ssqch.d.ts +150 -34
- package/bundled/starter/engines/index.edge +1 -0
- package/bundled/starter/engines/index.ejs +1 -0
- package/bundled/starter/engines/index.hbs +1 -0
- package/bundled/starter/engines/index.liquid +1 -0
- package/bundled/starter/engines/layout.edge +7 -0
- package/bundled/starter/engines/layout.ejs +4 -0
- package/bundled/starter/engines/layout.hbs +4 -0
- package/bundled/starter/engines/layout.liquid +4 -0
- package/bundled/starter/src/_data/site.json +1 -0
- package/bundled/starter/src/_includes/layout.jinja +4 -0
- package/bundled/starter/src/index.jinja +1 -0
- package/bundled/starter/ssqch.config.js +14 -1
- package/bundled/starter-docs/engines/edge/base.edge +7 -0
- package/bundled/starter-docs/engines/edge/doc.edge +4 -0
- package/bundled/starter-docs/engines/ejs/base.ejs +4 -0
- package/bundled/starter-docs/engines/ejs/doc.ejs +4 -0
- package/bundled/starter-docs/engines/hbs/base.hbs +4 -0
- package/bundled/starter-docs/engines/hbs/doc.hbs +3 -0
- package/bundled/starter-docs/engines/liquid/base.liquid +4 -0
- package/bundled/starter-docs/engines/liquid/doc.liquid +4 -0
- package/bundled/starter-docs/src/_data/site.json +1 -0
- package/bundled/starter-docs/src/_includes/base.jinja +4 -0
- package/bundled/starter-docs/src/_includes/doc.jinja +4 -0
- package/bundled/starter-docs/src/assets/docs.css +4 -0
- package/bundled/starter-docs/src/assets/docs.js +17 -0
- package/bundled/starter-docs/ssqch.config.js +14 -1
- package/lib/assets.js +13 -11
- package/lib/chunk-25WERNDD.js +112 -0
- package/lib/{chunk-H5K2ZE7B.js → chunk-2BJFGKOE.js} +13 -5
- package/lib/chunk-2FKYWYAB.js +268 -0
- package/lib/{chunk-LJOURBYT.js → chunk-3ZTRIO6O.js} +21 -19
- package/lib/{chunk-IOBC665M.js → chunk-4AZFCSGJ.js} +5 -3
- package/lib/{chunk-HWW5NCVJ.js → chunk-4Q6WMTER.js} +1 -1
- package/lib/{chunk-V2FSMOFX.js → chunk-55WXDGO4.js} +3 -3
- package/lib/{chunk-ZR3JYLFB.js → chunk-6FY77I4M.js} +331 -58
- package/lib/{chunk-JC54PHIT.js → chunk-6OUCRDYI.js} +514 -141
- package/lib/{chunk-ERAIEV3O.js → chunk-6U5VIQVY.js} +9 -7
- package/lib/{chunk-Z5OP43HU.js → chunk-7U5GWTEH.js} +455 -94
- package/lib/{chunk-CMJ7X5WW.js → chunk-AIJNG6MJ.js} +3 -2
- package/lib/{chunk-3K237XAX.js → chunk-C2Q7JKFI.js} +12 -10
- package/lib/{chunk-GS5B3CBW.js → chunk-DDV6JEC2.js} +1 -1
- package/lib/{chunk-A75EVUJX.js → chunk-DFJFHULZ.js} +47 -20
- package/lib/{chunk-KZZS4W2V.js → chunk-ENWDM2RW.js} +45 -42
- package/lib/{chunk-I3HYKEEW.js → chunk-ER72RPD6.js} +3 -3
- package/lib/chunk-F3JPNFCZ.js +23 -0
- package/lib/{chunk-B5E27PLU.js → chunk-FENJHLNM.js} +6 -3
- package/lib/{chunk-UU43WIZG.js → chunk-FJML7INB.js} +4 -2
- package/lib/{chunk-KCF2Z6N7.js → chunk-FQZDUDFK.js} +5 -3
- package/lib/{chunk-GJNIQAIH.js → chunk-GSNRAGKQ.js} +13 -6
- package/lib/{chunk-443ZQLVX.js → chunk-GU7BBYWB.js} +5 -4
- package/lib/{chunk-X2GAVYV2.js → chunk-HDKU6LRI.js} +110 -748
- package/lib/chunk-J3C2LEW7.js +121 -0
- package/lib/{chunk-XS4EJSEK.js → chunk-K5WZ2VYK.js} +7 -5
- package/lib/{chunk-3HZZY3Y7.js → chunk-OOKBXQAY.js} +7 -6
- package/lib/chunk-P2WS4RM4.js +707 -0
- package/lib/{chunk-RBNPBTDP.js → chunk-SNQOHNXE.js} +1 -1
- package/lib/{chunk-HFSWUTXX.js → chunk-SPIFZBIW.js} +1 -1
- package/lib/{chunk-QLUTNR37.js → chunk-T5IUI7W7.js} +12 -11
- package/lib/{chunk-ZINLHOX4.js → chunk-TGSVSG2G.js} +3 -2
- package/lib/{chunk-2L3HR67O.js → chunk-U2KEMVXO.js} +24 -16
- package/lib/{chunk-RYIWYWRQ.js → chunk-UHRBPZ4A.js} +7 -5
- package/lib/{chunk-2QTJTEBV.js → chunk-ULCT3PAV.js} +1 -1
- package/lib/{chunk-FCM3NYFR.js → chunk-UZNUS7RP.js} +12 -9
- package/lib/{chunk-GLJQ4C76.js → chunk-V3G2QGL3.js} +13 -106
- package/lib/{chunk-Z44IAMNG.js → chunk-VILOEVK7.js} +60 -28
- package/lib/chunk-VJWQSYEG.js +119 -0
- package/lib/{chunk-5ELAUHRL.js → chunk-WGAIE3DD.js} +23 -19
- package/lib/{chunk-OQGXZYZS.js → chunk-WUCRAV36.js} +13 -7
- package/lib/{chunk-RZYAIX2R.js → chunk-XYAWJTHM.js} +11 -10
- package/lib/{chunk-OSBEH67S.js → chunk-YA23NDMW.js} +5 -3
- package/lib/{chunk-AIMEXBTK.js → chunk-YNJNMQWU.js} +37 -142
- package/lib/{chunk-QJ5ZFTML.js → chunk-ZMG25MXF.js} +20 -18
- package/lib/cli.js +72 -35
- package/lib/elements.js +13 -11
- package/lib/from-hugo.js +36 -0
- package/lib/from-jekyll.js +41 -0
- package/lib/from-mkdocs.js +49 -0
- package/lib/from-vitepress.js +49 -0
- package/lib/image.js +12 -11
- package/lib/links.js +13 -11
- package/lib/llms.js +613 -0
- package/lib/minify.js +14 -12
- package/lib/redirects.js +13 -11
- package/lib/robots.js +87 -0
- package/lib/rss.js +24 -13
- package/lib/sass.js +12 -11
- package/lib/sitemap.js +23 -18
- package/lib/ssqch.js +6 -5
- package/lib/vue.js +400 -0
- package/package.json +29 -1
- package/types/from-hugo.d.ts +5 -0
- package/types/from-jekyll.d.ts +11 -0
- package/types/from-mkdocs.d.ts +11 -0
- package/types/from-vitepress.d.ts +5 -0
- package/types/index.d.ts +51 -31
- package/types/llms.d.ts +27 -0
- package/types/robots.d.ts +13 -0
- package/types/sass.d.ts +1 -1
- package/types/sitemap.d.ts +2 -2
- package/types/vue.d.ts +17 -0
- package/wasm/markdown.wasm +0 -0
- package/lib/chunk-RVXGUMFI.js +0 -21
- /package/lib/{chunk-ZR3JYLFB.js.LEGAL.txt → chunk-6FY77I4M.js.LEGAL.txt} +0 -0
- /package/lib/{chunk-AIMEXBTK.js.LEGAL.txt → chunk-YNJNMQWU.js.LEGAL.txt} +0 -0
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{{ title ? `${title} | ${site.title}` : site.title }}</title>
|
|
7
7
|
<meta name="description" content="{{ description || site.description }}">
|
|
8
|
+
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
|
9
|
+
{{-- For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). --}}
|
|
10
|
+
@let(copy = markdownCopy(page.url))
|
|
11
|
+
@if(copy)
|
|
12
|
+
<link rel="alternate" type="text/markdown" href="{{ copy }}">
|
|
13
|
+
@end
|
|
14
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
15
|
<style>
|
|
9
16
|
/* Ranger Station '76: soft white (or green charcoal in dark mode), neutral text, pine
|
|
10
17
|
headings, burnt orange links, and a four-color stripe under the header. */
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title><% if (locals.title) { %><%= title %> | <% } %><%= site.title %></title>
|
|
7
7
|
<meta name="description" content="<%= locals.description || site.description %>">
|
|
8
|
+
<link rel="canonical" href="<%= site.url %><%= page.url %>">
|
|
9
|
+
<%# For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). %>
|
|
10
|
+
<% const copy = markdownCopy(page.url); if (copy) { %><link rel="alternate" type="text/markdown" href="<%= copy %>"><% } %>
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<style>
|
|
9
13
|
/* Ranger Station '76: soft white (or green charcoal in dark mode), neutral text, pine
|
|
10
14
|
headings, burnt orange links, and a four-color stripe under the header. */
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{{#if title}}{{title}} | {{/if}}{{site.title}}</title>
|
|
7
7
|
<meta name="description" content="{{#if description}}{{description}}{{else}}{{site.description}}{{/if}}">
|
|
8
|
+
<link rel="canonical" href="{{site.url}}{{page.url}}">
|
|
9
|
+
{{!-- For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). --}}
|
|
10
|
+
{{#with (markdownCopy page.url)}}<link rel="alternate" type="text/markdown" href="{{this}}">{{/with}}
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<style>
|
|
9
13
|
/* Ranger Station '76: soft white (or green charcoal in dark mode), neutral text, pine
|
|
10
14
|
headings, burnt orange links, and a four-color stripe under the header. */
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{% if title %}{{ title }} | {% endif %}{{ site.title }}</title>
|
|
7
7
|
<meta name="description" content="{{ description | default: site.description }}">
|
|
8
|
+
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
|
9
|
+
{% comment %} For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). {% endcomment %}
|
|
10
|
+
{% assign copy = page.url | markdownCopy %}{% if copy != "" %}<link rel="alternate" type="text/markdown" href="{{ copy }}">{% endif %}
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<style>
|
|
9
13
|
/* Ranger Station '76: soft white (or green charcoal in dark mode), neutral text, pine
|
|
10
14
|
headings, burnt orange links, and a four-color stripe under the header. */
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{% if title %}{{ title }} | {% endif %}{{ site.title }}</title>
|
|
7
7
|
<meta name="description" content="{{ description or site.description }}">
|
|
8
|
+
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
|
9
|
+
{# For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). #}
|
|
10
|
+
{% if markdownCopy(page.url) %}<link rel="alternate" type="text/markdown" href="{{ markdownCopy(page.url) }}">{% endif %}
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<style>
|
|
9
13
|
/* Ranger Station '76: soft white (or green charcoal in dark mode), neutral text, pine
|
|
10
14
|
headings, burnt orange links, and a four-color stripe under the header. */
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
// The site's config. `ssqch build` builds it into dist/, and `ssqch serve`
|
|
2
2
|
// serves it with live reload. ssqch.d.ts gives your editor the types.
|
|
3
|
-
import { defineConfig } from "ssqch";
|
|
3
|
+
import { defineConfig, readData } from "ssqch";
|
|
4
4
|
import { imagePlugin } from "ssqch/image";
|
|
5
5
|
import { linksPlugin } from "ssqch/links";
|
|
6
|
+
import { llmsPlugin } from "ssqch/llms";
|
|
6
7
|
import { minifyPlugin } from "ssqch/minify";
|
|
8
|
+
import { robotsPlugin } from "ssqch/robots";
|
|
9
|
+
import { sitemapPlugin } from "ssqch/sitemap";
|
|
10
|
+
|
|
11
|
+
// The site's address, from src/_data/site.json: put yours there.
|
|
12
|
+
const { url } = readData("src/_data/site.json");
|
|
7
13
|
|
|
8
14
|
export default defineConfig(({ env }) => ({
|
|
9
15
|
dirs: { input: "src", output: "dist" },
|
|
@@ -24,6 +30,13 @@ export default defineConfig(({ env }) => ({
|
|
|
24
30
|
imagePlugin({ formats: ["webp", "auto"], widths: [400, 800, 1200] }),
|
|
25
31
|
// Broken internal links fail a production build.
|
|
26
32
|
linksPlugin(),
|
|
33
|
+
// What crawlers and agents read: sitemap.xml, robots.txt, and llms.txt with a
|
|
34
|
+
// Markdown copy of each page. `ssqch patrol` checks them after a build.
|
|
35
|
+
sitemapPlugin({ url }),
|
|
36
|
+
// `false` keeps that kind of AI crawler out: training (collecting pages to train
|
|
37
|
+
// models), search (AI search answers) or fetch (a page a person asked about).
|
|
38
|
+
robotsPlugin({ ai: { training: true, search: true, fetch: true } }),
|
|
39
|
+
llmsPlugin({ url }),
|
|
27
40
|
env === "production" && minifyPlugin(),
|
|
28
41
|
],
|
|
29
42
|
}));
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{{ title ? title + ' | ' : '' }}{{ site.name }}</title>
|
|
7
7
|
<meta name="description" content="{{ description || site.description }}">
|
|
8
|
+
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
|
9
|
+
{{-- For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). --}}
|
|
10
|
+
@let(copy = markdownCopy(page.url))
|
|
11
|
+
@if(copy)
|
|
12
|
+
<link rel="alternate" type="text/markdown" href="{{ copy }}">
|
|
13
|
+
@end
|
|
14
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
15
|
<meta name="generator" content="{{ ssqch.generator }}">
|
|
9
16
|
<link rel="stylesheet" href="/highlight.css">
|
|
10
17
|
<link rel="stylesheet" href="/assets/docs.css">
|
|
@@ -17,6 +17,10 @@ sidebar: true
|
|
|
17
17
|
{{{ content }}}
|
|
18
18
|
|
|
19
19
|
<footer class="page-footer">
|
|
20
|
+
@let(copy = markdownCopy(page.url))
|
|
21
|
+
@if(copy)
|
|
22
|
+
<p class="page-markdown"><a href="{{ copy }}">View as Markdown</a> <button type="button" data-copy-markdown="{{ copy }}" hidden>Copy as Markdown</button></p>
|
|
23
|
+
@end
|
|
20
24
|
@if(site.editUrl)
|
|
21
25
|
<p><a href="{{ site.editUrl }}{{ page.inputPath.replace('./', '') }}">Edit this page</a></p>
|
|
22
26
|
@end
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title><% if (locals.title) { %><%= title %> | <% } %><%= site.name %></title>
|
|
7
7
|
<meta name="description" content="<%= locals.description || site.description %>">
|
|
8
|
+
<link rel="canonical" href="<%= site.url %><%= page.url %>">
|
|
9
|
+
<%# For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). %>
|
|
10
|
+
<% const copy = markdownCopy(page.url); if (copy) { %><link rel="alternate" type="text/markdown" href="<%= copy %>"><% } %>
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<meta name="generator" content="<%= ssqch.generator %>">
|
|
9
13
|
<link rel="stylesheet" href="/highlight.css">
|
|
10
14
|
<link rel="stylesheet" href="/assets/docs.css">
|
|
@@ -17,6 +17,10 @@ sidebar: true
|
|
|
17
17
|
<%- content %>
|
|
18
18
|
|
|
19
19
|
<footer class="page-footer">
|
|
20
|
+
<%_ const copy = markdownCopy(page.url); _%>
|
|
21
|
+
<%_ if (copy) { _%>
|
|
22
|
+
<p class="page-markdown"><a href="<%= copy %>">View as Markdown</a> <button type="button" data-copy-markdown="<%= copy %>" hidden>Copy as Markdown</button></p>
|
|
23
|
+
<%_ } _%>
|
|
20
24
|
<%_ if (site.editUrl) { _%>
|
|
21
25
|
<p><a href="<%= site.editUrl %><%= page.inputPath.replace("./", "") %>">Edit this page</a></p>
|
|
22
26
|
<%_ } _%>
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{{#if title}}{{title}} | {{/if}}{{site.name}}</title>
|
|
7
7
|
<meta name="description" content="{{#if description}}{{description}}{{else}}{{site.description}}{{/if}}">
|
|
8
|
+
<link rel="canonical" href="{{site.url}}{{page.url}}">
|
|
9
|
+
{{!-- For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). --}}
|
|
10
|
+
{{#with (markdownCopy page.url)}}<link rel="alternate" type="text/markdown" href="{{this}}">{{/with}}
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<meta name="generator" content="{{ssqch.generator}}">
|
|
9
13
|
<link rel="stylesheet" href="/highlight.css">
|
|
10
14
|
<link rel="stylesheet" href="/assets/docs.css">
|
|
@@ -16,6 +16,9 @@ sidebar: true
|
|
|
16
16
|
{{{content}}}
|
|
17
17
|
|
|
18
18
|
<footer class="page-footer">
|
|
19
|
+
{{#with (markdownCopy page.url)}}
|
|
20
|
+
<p class="page-markdown"><a href="{{this}}">View as Markdown</a> <button type="button" data-copy-markdown="{{this}}" hidden>Copy as Markdown</button></p>
|
|
21
|
+
{{/with}}
|
|
19
22
|
{{#if site.editUrl}}
|
|
20
23
|
<p><a href="{{site.editUrl}}{{sourcePath page.inputPath}}">Edit this page</a></p>
|
|
21
24
|
{{/if}}
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{% if title and title != "" %}{{ title }} | {% endif %}{{ site.name }}</title>
|
|
7
7
|
<meta name="description" content="{{ description | default: site.description }}">
|
|
8
|
+
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
|
9
|
+
{% comment %} For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). {% endcomment %}
|
|
10
|
+
{% assign copy = page.url | markdownCopy %}{% if copy != "" %}<link rel="alternate" type="text/markdown" href="{{ copy }}">{% endif %}
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<meta name="generator" content="{{ ssqch.generator }}">
|
|
9
13
|
<link rel="stylesheet" href="/highlight.css">
|
|
10
14
|
<link rel="stylesheet" href="/assets/docs.css">
|
|
@@ -17,6 +17,10 @@ sidebar: true
|
|
|
17
17
|
{{ content }}
|
|
18
18
|
|
|
19
19
|
<footer class="page-footer">
|
|
20
|
+
{% assign copy = page.url | markdownCopy %}
|
|
21
|
+
{% if copy != "" %}
|
|
22
|
+
<p class="page-markdown"><a href="{{ copy }}">View as Markdown</a> <button type="button" data-copy-markdown="{{ copy }}" hidden>Copy as Markdown</button></p>
|
|
23
|
+
{% endif %}
|
|
20
24
|
{% if site.editUrl and site.editUrl != "" %}
|
|
21
25
|
<p><a href="{{ site.editUrl }}{{ page.inputPath | replace_first: './', '' }}">Edit this page</a></p>
|
|
22
26
|
{% endif %}
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>{% if title %}{{ title }} | {% endif %}{{ site.name }}</title>
|
|
7
7
|
<meta name="description" content="{{ description or site.description }}">
|
|
8
|
+
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
|
9
|
+
{# For agents: the page as Markdown and the site's map (llmsPlugin() in ssqch.config.js). #}
|
|
10
|
+
{% if markdownCopy(page.url) %}<link rel="alternate" type="text/markdown" href="{{ markdownCopy(page.url) }}">{% endif %}
|
|
11
|
+
<link rel="describedby" href="/llms.txt">
|
|
8
12
|
<meta name="generator" content="{{ ssqch.generator }}">
|
|
9
13
|
<link rel="stylesheet" href="/highlight.css">
|
|
10
14
|
<link rel="stylesheet" href="/assets/docs.css">
|
|
@@ -17,6 +17,10 @@ sidebar: true
|
|
|
17
17
|
{{ content }}
|
|
18
18
|
|
|
19
19
|
<footer class="page-footer">
|
|
20
|
+
{% set copy = markdownCopy(page.url) %}
|
|
21
|
+
{% if copy %}
|
|
22
|
+
<p class="page-markdown"><a href="{{ copy }}">View as Markdown</a> <button type="button" data-copy-markdown="{{ copy }}" hidden>Copy as Markdown</button></p>
|
|
23
|
+
{% endif %}
|
|
20
24
|
{% if site.editUrl %}
|
|
21
25
|
<p><a href="{{ site.editUrl }}{{ page.inputPath | replace('./', '') }}">Edit this page</a></p>
|
|
22
26
|
{% endif %}
|
|
@@ -237,6 +237,10 @@ summary { font-weight: 600; cursor: pointer; }
|
|
|
237
237
|
.tabs [role="tablist"] ~ .tab { border-top: 0; }
|
|
238
238
|
|
|
239
239
|
.page-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); }
|
|
240
|
+
/* The page as Markdown, for agents: a link, and a button docs.js turns on. */
|
|
241
|
+
.page-markdown { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
|
|
242
|
+
.page-markdown button { padding: 0.25rem 0.7rem; border: 1px solid var(--muted); border-radius: 0.375rem; background: none; color: var(--text); font: inherit; cursor: pointer; }
|
|
243
|
+
.page-markdown button:hover { background: var(--selected); }
|
|
240
244
|
.pager { display: flex; justify-content: space-between; gap: 1rem; }
|
|
241
245
|
.footnotes { margin-top: 2.5rem; font-size: 0.9rem; color: var(--muted); }
|
|
242
246
|
|
|
@@ -65,3 +65,20 @@ const { PagefindUI } = /** @type {any} */ (window);
|
|
|
65
65
|
if (PagefindUI && document.getElementById("search")) {
|
|
66
66
|
new PagefindUI({ element: "#search", showSubResults: true });
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
// Copy as Markdown: the page's Markdown copy (llmsPlugin() writes it), for pasting into a chat
|
|
70
|
+
// with an agent. The button stays hidden where there's no clipboard to copy to.
|
|
71
|
+
for (const button of document.querySelectorAll("[data-copy-markdown]")) {
|
|
72
|
+
if (!navigator.clipboard) continue;
|
|
73
|
+
button.hidden = false;
|
|
74
|
+
button.addEventListener("click", async () => {
|
|
75
|
+
try {
|
|
76
|
+
const response = await fetch(button.dataset.copyMarkdown);
|
|
77
|
+
await navigator.clipboard.writeText(await response.text());
|
|
78
|
+
button.textContent = "Copied";
|
|
79
|
+
} catch {
|
|
80
|
+
button.textContent = "Couldn't copy";
|
|
81
|
+
}
|
|
82
|
+
setTimeout(() => { button.textContent = "Copy as Markdown"; }, 2000);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
// A documentation site. `ssqch serve` serves it with live reload, and
|
|
2
2
|
// `ssqch build` builds it into dist/. ssqch.d.ts gives your editor the types.
|
|
3
|
-
import { defineConfig } from "ssqch";
|
|
3
|
+
import { defineConfig, readData } from "ssqch";
|
|
4
4
|
import { linksPlugin } from "ssqch/links";
|
|
5
|
+
import { llmsPlugin } from "ssqch/llms";
|
|
5
6
|
import { minifyPlugin } from "ssqch/minify";
|
|
7
|
+
import { robotsPlugin } from "ssqch/robots";
|
|
8
|
+
import { sitemapPlugin } from "ssqch/sitemap";
|
|
9
|
+
|
|
10
|
+
// The site's address, from src/_data/site.json: put yours there.
|
|
11
|
+
const { url } = readData("src/_data/site.json");
|
|
6
12
|
|
|
7
13
|
// Search is Pagefind (https://pagefind.app), which indexes the built pages.
|
|
8
14
|
// It's a program of its own that npx fetches, so it's opt-in:
|
|
@@ -35,6 +41,13 @@ export default defineConfig(({ env }) => ({
|
|
|
35
41
|
plugins: [
|
|
36
42
|
// Broken internal links (and anchors) fail a production build.
|
|
37
43
|
linksPlugin({ ignore: ["/pagefind/"] }),
|
|
44
|
+
// What crawlers and agents read: sitemap.xml, robots.txt, and llms.txt with a
|
|
45
|
+
// Markdown copy of each page (each page links its copy). `ssqch patrol` checks them.
|
|
46
|
+
sitemapPlugin({ url }),
|
|
47
|
+
// `false` keeps that kind of AI crawler out: training (collecting pages to train
|
|
48
|
+
// models), search (AI search answers) or fetch (a page a person asked about).
|
|
49
|
+
robotsPlugin({ ai: { training: true, search: true, fetch: true } }),
|
|
50
|
+
llmsPlugin({ url }),
|
|
38
51
|
env === "production" && minifyPlugin(),
|
|
39
52
|
],
|
|
40
53
|
}));
|
package/lib/assets.js
CHANGED
|
@@ -2,29 +2,31 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
Options
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SNQOHNXE.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
blake3Hex,
|
|
9
9
|
rewriteHtml
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-VILOEVK7.js";
|
|
11
|
+
import "./chunk-ULCT3PAV.js";
|
|
12
|
+
import "./chunk-6U5VIQVY.js";
|
|
13
13
|
import "./chunk-AD3HAW3W.js";
|
|
14
14
|
import "./chunk-YCOTX2VM.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-DDV6JEC2.js";
|
|
16
|
+
import "./chunk-6OUCRDYI.js";
|
|
17
|
+
import "./chunk-SPIFZBIW.js";
|
|
18
18
|
import "./chunk-FVZ5JBRI.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-FJML7INB.js";
|
|
20
|
+
import "./chunk-4AZFCSGJ.js";
|
|
21
21
|
import "./chunk-CMUWRPSQ.js";
|
|
22
22
|
import {
|
|
23
23
|
bail,
|
|
24
|
-
displayPath,
|
|
25
24
|
warn,
|
|
26
25
|
warning
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YNJNMQWU.js";
|
|
27
|
+
import {
|
|
28
|
+
displayPath
|
|
29
|
+
} from "./chunk-VJWQSYEG.js";
|
|
28
30
|
import "./chunk-I3PS26CI.js";
|
|
29
31
|
|
|
30
32
|
// src/modules/assets.ts
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
2
|
+
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/content.ts
|
|
5
|
+
var HEADING = /<h([1-6])(\s[^>]*)?>(.*?)<\/h[1-6]\s*>/gis;
|
|
6
|
+
var ID_ATTR = /(?:^|\s)id\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/i;
|
|
7
|
+
var TAG = /<(\/?)([A-Za-z][A-Za-z0-9-]*)([^>]*)>|<!--.*?-->/gs;
|
|
8
|
+
var HIDDEN = /\saria-hidden\s*=\s*["']?true|\sclass\s*=\s*["'][^"']*\bheader-anchor\b/i;
|
|
9
|
+
var CODE = /<!--.*?-->|<(pre|script|style|template|textarea)\b.*?<\/(?:pre|script|style|template|textarea)\s*>/gis;
|
|
10
|
+
var CODE_WITH_HEADING = /<code\b(?:(?!<\/code\s*>).)*?<h[1-6][\s>](?:(?!<\/code\s*>).)*<\/code\s*>/gis;
|
|
11
|
+
var VOID = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
|
|
12
|
+
function headings(html) {
|
|
13
|
+
if (!html.includes("<h") && !html.includes("<H")) return [];
|
|
14
|
+
const out = [];
|
|
15
|
+
for (const found of html.replace(CODE, "").replace(CODE_WITH_HEADING, "").matchAll(HEADING)) {
|
|
16
|
+
const id = ID_ATTR.exec(found[2] ?? "");
|
|
17
|
+
const value = id ? id[1] ?? id[2] ?? id[3] : void 0;
|
|
18
|
+
out.push({ level: Number(found[1]), id: value === void 0 ? void 0 : decodeEntities(value), text: htmlText(found[3]) });
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
function htmlText(html) {
|
|
23
|
+
let text = "";
|
|
24
|
+
let hidden = 0;
|
|
25
|
+
let last = 0;
|
|
26
|
+
for (const found of html.matchAll(TAG)) {
|
|
27
|
+
if (hidden === 0) text += html.slice(last, found.index);
|
|
28
|
+
last = found.index + found[0].length;
|
|
29
|
+
if (found[2] === void 0) continue;
|
|
30
|
+
const name = found[2].toLowerCase();
|
|
31
|
+
const attrs = found[3] ?? "";
|
|
32
|
+
if (VOID.has(name) || attrs.endsWith("/")) {
|
|
33
|
+
if (name === "br" && hidden === 0) text += " ";
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (found[1] === "/") hidden = Math.max(0, hidden - 1);
|
|
37
|
+
else if (hidden > 0 || HIDDEN.test(attrs)) hidden++;
|
|
38
|
+
}
|
|
39
|
+
if (hidden === 0) text += html.slice(last);
|
|
40
|
+
return splitWhitespace(decodeEntities(text)).join(" ");
|
|
41
|
+
}
|
|
42
|
+
function splitWhitespace(text) {
|
|
43
|
+
return text.split(/[\t-\r \u0085\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+/).filter((word) => word !== "");
|
|
44
|
+
}
|
|
45
|
+
var ENTITY = /&(#[0-9]{1,7}|#[xX][0-9A-Fa-f]{1,6}|[A-Za-z]+);/g;
|
|
46
|
+
var NAMED = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'", nbsp: "\xA0" };
|
|
47
|
+
function decodeEntities(s) {
|
|
48
|
+
if (!s.includes("&")) return s;
|
|
49
|
+
return s.replace(ENTITY, (whole, name) => {
|
|
50
|
+
if (Object.hasOwn(NAMED, name)) return NAMED[name];
|
|
51
|
+
if (name[0] !== "#") return whole;
|
|
52
|
+
const code = name[1] === "x" || name[1] === "X" ? Number.parseInt(name.slice(2), 16) : Number.parseInt(name.slice(1), 10);
|
|
53
|
+
return code <= 1114111 && !(code >= 55296 && code <= 57343) ? String.fromCodePoint(code) : whole;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function escapeText(s) {
|
|
57
|
+
return s.replace(/[&<>"]/g, (c) => c === "&" ? "&" : c === "<" ? "<" : c === ">" ? ">" : """);
|
|
58
|
+
}
|
|
59
|
+
function escapeHtml(s) {
|
|
60
|
+
return s.replace(/[&<>"']/g, (c) => c === "&" ? "&" : c === "<" ? "<" : c === ">" ? ">" : c === '"' ? """ : "'");
|
|
61
|
+
}
|
|
62
|
+
function excerpt(html) {
|
|
63
|
+
const more = /<!--\s*more\s*-->/.exec(html);
|
|
64
|
+
if (more) return html.slice(0, more.index).trim();
|
|
65
|
+
return /<p(?:\s[^>]*)?>.*?<\/p>/is.exec(html)?.[0];
|
|
66
|
+
}
|
|
67
|
+
function toc(list, from, to, ordered, markup = {}) {
|
|
68
|
+
const tag = ordered ? "ol" : "ul";
|
|
69
|
+
const attr = (name, value) => value ? ` ${name}="${escapeHtml(value)}"` : "";
|
|
70
|
+
const open = (outer) => `<${tag}${outer ? attr("id", markup.id) + attr("class", markup.class) : attr("class", markup.sublistClass)}>`;
|
|
71
|
+
const link = attr("class", markup.linkClass);
|
|
72
|
+
const items = [];
|
|
73
|
+
for (const v of list) {
|
|
74
|
+
const h = v;
|
|
75
|
+
if (typeof h?.level !== "number") continue;
|
|
76
|
+
const level = Math.trunc(h.level);
|
|
77
|
+
const id = typeof h.id === "string" && h.id !== "" ? h.id : void 0;
|
|
78
|
+
if (id !== void 0 && level >= from && level <= to) items.push({ level, id, text: String(h.text) });
|
|
79
|
+
}
|
|
80
|
+
let out = "";
|
|
81
|
+
const stack = [];
|
|
82
|
+
for (const h of items) {
|
|
83
|
+
if (!stack.length) {
|
|
84
|
+
out += open(true);
|
|
85
|
+
stack.push(h.level);
|
|
86
|
+
} else {
|
|
87
|
+
while (stack.length > 1 && h.level < stack[stack.length - 1]) {
|
|
88
|
+
out += `</li></${tag}>`;
|
|
89
|
+
stack.pop();
|
|
90
|
+
}
|
|
91
|
+
if (h.level > stack[stack.length - 1]) {
|
|
92
|
+
out += open(false);
|
|
93
|
+
stack.push(h.level);
|
|
94
|
+
} else {
|
|
95
|
+
out += "</li>";
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
out += `<li${attr("class", markup.itemClass?.replaceAll("{level}", String(h.level)))}><a href="#${escapeHtml(h.id ?? "")}"${link}>${escapeText(h.text)}</a>`;
|
|
99
|
+
}
|
|
100
|
+
for (const _ of stack) out += `</li></${tag}>`;
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
headings,
|
|
106
|
+
htmlText,
|
|
107
|
+
splitWhitespace,
|
|
108
|
+
decodeEntities,
|
|
109
|
+
escapeText,
|
|
110
|
+
excerpt,
|
|
111
|
+
toc
|
|
112
|
+
};
|
|
@@ -2,15 +2,17 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
commandLine
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4Q6WMTER.js";
|
|
6
6
|
import {
|
|
7
7
|
compareRuns,
|
|
8
8
|
runsText
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HDKU6LRI.js";
|
|
10
10
|
import {
|
|
11
|
-
compareText,
|
|
12
11
|
red
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YNJNMQWU.js";
|
|
13
|
+
import {
|
|
14
|
+
compareText
|
|
15
|
+
} from "./chunk-VJWQSYEG.js";
|
|
14
16
|
|
|
15
17
|
// src/commands/baseline.ts
|
|
16
18
|
import { spawnSync } from "node:child_process";
|
|
@@ -141,8 +143,14 @@ time: ${new Date(time * 1e3).toISOString().replace("T", " ").replace(/\.\d+Z$/,
|
|
|
141
143
|
say(`Wrote ${reference}: each file's most common version of the ${names.length} builds, to compare ssqch's with.`);
|
|
142
144
|
}
|
|
143
145
|
}
|
|
146
|
+
let pkg = "";
|
|
147
|
+
try {
|
|
148
|
+
pkg = fs.readFileSync(path.join(root, "package.json"), "utf8");
|
|
149
|
+
} catch {
|
|
150
|
+
}
|
|
151
|
+
if (/"(?:vite|vitepress|astro|@vitejs\/[\w-]+)"\s*:/.test(pkg)) say("This site builds with Vite: its asset names (`style.Bfpn8qS8.css`) and Vue's scope ids (`data-v-*`) come from each file's path, so these builds' differ from a build in the site's own folder. `ssqch diff` leaves both out; to compare a build of your own with these, build it in a copy too, or use `--copy-installs`.");
|
|
144
152
|
process.stdout.write(`
|
|
145
|
-
Next: build with ssqch into an empty folder, then \`ssqch diff ${reference} <ssqch's output>\`${code ? ", with an --ignore for what varies above" : ""}, and fix the biggest group first. The whole loop: \`ssqch docs "moving a site with an agent"\`.
|
|
153
|
+
Next: build with ssqch into an empty folder, then \`ssqch diff ${reference} <ssqch's output>\`${code ? ", with an --ignore for what varies above" : ""}, and fix the biggest group first. \`--text\` says how much of each page's text matches, for a move that can't be byte for byte. The whole loop: \`ssqch docs "moving a site with an agent"\`.
|
|
146
154
|
`);
|
|
147
155
|
return code;
|
|
148
156
|
} catch (e) {
|