ssqch 0.9.0 → 0.10.1
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/README.md +1 -1
- package/bundled/completions/bash +1 -1
- package/bundled/completions/elvish +1 -0
- package/bundled/completions/fish +1 -0
- package/bundled/completions/powershell +1 -0
- package/bundled/completions/zsh +1 -0
- package/bundled/docs/agents.md +70 -0
- package/bundled/docs/benchmarks.md +29 -0
- package/bundled/docs/build-summary.md +57 -0
- package/bundled/docs/comparing-builds.md +51 -0
- package/bundled/docs/configuring.md +138 -0
- package/bundled/docs/content-schemas.md +54 -0
- package/bundled/docs/css-and-javascript.md +33 -0
- package/bundled/docs/data-files.md +55 -0
- package/bundled/docs/deploying.md +47 -0
- package/bundled/docs/field-guide.md +144 -0
- package/bundled/docs/footprint.md +27 -0
- package/bundled/docs/github-pages.md +41 -0
- package/bundled/docs/index.md +26 -0
- package/bundled/docs/install.md +27 -0
- package/bundled/docs/known-gaps.md +18 -0
- package/bundled/docs/markdown.md +114 -0
- package/bundled/docs/multilingual.md +14 -0
- package/bundled/docs/nav.yml +50 -0
- package/bundled/docs/netlify.md +30 -0
- package/bundled/docs/new-pages.md +42 -0
- package/bundled/docs/plugins.md +13 -0
- package/bundled/docs/rust-plugins.md +32 -0
- package/bundled/docs/seo.md +19 -0
- package/bundled/docs/template-languages.md +106 -0
- package/bundled/docs/templates.md +37 -0
- package/bundled/docs/themes.md +31 -0
- package/bundled/{trailheads → docs/trailheads}/from-component-frameworks.md +7 -3
- package/bundled/{trailheads → docs/trailheads}/from-docusaurus.md +7 -4
- package/bundled/{trailheads → docs/trailheads}/from-eleventy.md +7 -4
- package/bundled/{trailheads → docs/trailheads}/from-hexo.md +7 -4
- package/bundled/{trailheads → docs/trailheads}/from-jekyll.md +6 -3
- package/bundled/{trailheads → docs/trailheads}/from-mkdocs.md +8 -5
- package/bundled/{trailheads → docs/trailheads}/from-zola.md +6 -3
- package/bundled/docs/trailheads.md +38 -0
- package/bundled/docs/where-values-come-from.md +57 -0
- package/bundled/ssqch.d.ts +10 -3
- package/lib/assets.js +18 -12
- package/lib/{chunk-7PWCYHTJ.js → chunk-26SHWRC6.js} +6 -8
- package/lib/{chunk-GUKSZ2XM.js → chunk-3BQJY6GF.js} +4 -6
- package/lib/{chunk-TICWN55Z.js → chunk-3LODFCCH.js} +2 -3
- package/lib/{chunk-TVU3OPPK.js → chunk-3NDFUMV2.js} +3 -3
- package/lib/{chunk-YTHQBMDJ.js → chunk-6OUT5VFK.js} +3 -6
- package/lib/{chunk-HXCLCXRT.js → chunk-6RSZV5O2.js} +5 -3
- package/lib/{chunk-4Q6WMTER.js → chunk-7JGYYAKI.js} +1 -1
- package/lib/{chunk-MI6EJWA2.js → chunk-BT3NVQOD.js} +1 -1
- package/lib/{chunk-DDV6JEC2.js → chunk-BXARVN5Z.js} +1 -1
- package/lib/{chunk-RNJFPFXE.js → chunk-CXRHH5P5.js} +5 -6
- package/lib/{chunk-HPXAZ2HU.js → chunk-DNWA7WNO.js} +1 -1
- package/lib/{chunk-SURPOAW7.js → chunk-DTSTCVRX.js} +8 -9
- package/lib/{chunk-7SD7K567.js → chunk-DUGGZ4EE.js} +1 -1
- package/lib/{chunk-7XLK2GEG.js → chunk-ERNVEZOK.js} +1 -1
- package/lib/{chunk-3A647I3N.js → chunk-FYRC2HBU.js} +4 -6
- package/lib/{chunk-IJWHOFRP.js → chunk-FYU22VDK.js} +12 -13
- package/lib/{chunk-II5DEH3Q.js → chunk-FZGJUJAL.js} +5 -7
- package/lib/{chunk-BEGC7YP6.js → chunk-G67W2FTJ.js} +9 -11
- package/lib/{chunk-7RDRZHJD.js → chunk-HMVYNV6M.js} +13 -15
- package/lib/{chunk-DELWRJAO.js → chunk-HNG372DW.js} +143 -74
- package/lib/{chunk-47P4YREZ.js → chunk-II7ZRIAC.js} +11 -13
- package/lib/{chunk-NCWFYT74.js → chunk-IOXCGMSF.js} +5 -7
- package/lib/{chunk-GRWMGC7D.js → chunk-JFPLNHEQ.js} +2410 -2298
- package/lib/{chunk-LPHNACE4.js → chunk-LU73FTIR.js} +10 -11
- package/lib/{chunk-D2XE2GTY.js → chunk-LYPKL524.js} +9 -10
- package/lib/{chunk-NKXEPHRZ.js → chunk-MDB3D3LP.js} +106 -4
- package/lib/{chunk-CZ4XQC56.js → chunk-MDG5A4NI.js} +15 -13
- package/lib/{chunk-SXMJ52IK.js → chunk-MUYWL4ZX.js} +58 -19
- package/lib/{chunk-R7K3D5W5.js → chunk-P2TRR6XK.js} +83 -24
- package/lib/{chunk-SF4I6Z7S.js → chunk-R2YGC3VE.js} +2 -3
- package/lib/{chunk-76NTVE34.js → chunk-RFNLZM7W.js} +2 -4
- package/lib/{chunk-3K3ANWZ2.js → chunk-X7C6GFUM.js} +4 -4
- package/lib/{chunk-XMXBHXZR.js → chunk-XR7GFL4B.js} +12 -13
- package/lib/{chunk-NNUKIGOO.js → chunk-ZZBHBLDB.js} +16 -18
- package/lib/cli.js +25 -25
- package/lib/elements.js +10 -12
- package/lib/image.js +10 -11
- package/lib/links.js +13 -15
- package/lib/minify.js +9 -10
- package/lib/redirects.js +11 -13
- package/lib/rss.js +22 -22
- package/lib/sass.js +10 -12
- package/lib/sitemap.js +10 -12
- package/lib/ssqch.js +4 -5
- package/package.json +2 -2
- package/types/index.d.ts +9 -2
- package/types/rss.d.ts +1 -1
- package/bundled/README.md +0 -1314
- package/lib/chunk-VJWQSYEG.js +0 -119
- package/lib/{chunk-DELWRJAO.js.LEGAL.txt → chunk-HNG372DW.js.LEGAL.txt} +0 -0
- package/lib/{chunk-GRWMGC7D.js.LEGAL.txt → chunk-JFPLNHEQ.js.LEGAL.txt} +3 -3
package/lib/elements.js
CHANGED
|
@@ -2,36 +2,34 @@ 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-DUGGZ4EE.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
debugString,
|
|
9
9
|
rewriteHtml,
|
|
10
10
|
withBase
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-P2TRR6XK.js";
|
|
12
|
+
import "./chunk-ERNVEZOK.js";
|
|
13
13
|
import {
|
|
14
14
|
count
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MDB3D3LP.js";
|
|
16
16
|
import "./chunk-AD3HAW3W.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-BXARVN5Z.js";
|
|
18
|
+
import "./chunk-IOXCGMSF.js";
|
|
19
19
|
import "./chunk-FVZ5JBRI.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-DNWA7WNO.js";
|
|
21
21
|
import "./chunk-UU43WIZG.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RFNLZM7W.js";
|
|
23
23
|
import "./chunk-CMUWRPSQ.js";
|
|
24
24
|
import {
|
|
25
25
|
bail,
|
|
26
|
-
context
|
|
27
|
-
} from "./chunk-GRWMGC7D.js";
|
|
28
|
-
import {
|
|
29
26
|
compareText,
|
|
27
|
+
context,
|
|
30
28
|
displayPath,
|
|
31
29
|
isDir,
|
|
32
30
|
isFile,
|
|
33
31
|
slashes
|
|
34
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
35
33
|
import "./chunk-I3PS26CI.js";
|
|
36
34
|
|
|
37
35
|
// src/modules/elements.ts
|
package/lib/image.js
CHANGED
|
@@ -4,21 +4,20 @@ import {
|
|
|
4
4
|
image,
|
|
5
5
|
imagePlugin,
|
|
6
6
|
imageUrl
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-3NDFUMV2.js";
|
|
8
|
+
import "./chunk-DUGGZ4EE.js";
|
|
9
|
+
import "./chunk-P2TRR6XK.js";
|
|
10
|
+
import "./chunk-ERNVEZOK.js";
|
|
11
|
+
import "./chunk-MDB3D3LP.js";
|
|
12
12
|
import "./chunk-AD3HAW3W.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-BXARVN5Z.js";
|
|
14
|
+
import "./chunk-IOXCGMSF.js";
|
|
15
15
|
import "./chunk-FVZ5JBRI.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-DNWA7WNO.js";
|
|
17
17
|
import "./chunk-UU43WIZG.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RFNLZM7W.js";
|
|
19
19
|
import "./chunk-CMUWRPSQ.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-VJWQSYEG.js";
|
|
20
|
+
import "./chunk-JFPLNHEQ.js";
|
|
22
21
|
import "./chunk-I3PS26CI.js";
|
|
23
22
|
export {
|
|
24
23
|
image,
|
package/lib/links.js
CHANGED
|
@@ -2,41 +2,39 @@ 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-DUGGZ4EE.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
rewriteHtml
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-P2TRR6XK.js";
|
|
10
|
+
import "./chunk-ERNVEZOK.js";
|
|
11
11
|
import {
|
|
12
12
|
count
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MDB3D3LP.js";
|
|
14
14
|
import "./chunk-AD3HAW3W.js";
|
|
15
15
|
import {
|
|
16
16
|
dirsOf
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-BXARVN5Z.js";
|
|
18
|
+
import "./chunk-IOXCGMSF.js";
|
|
19
19
|
import {
|
|
20
20
|
closest,
|
|
21
21
|
closestPathFinder
|
|
22
22
|
} from "./chunk-FVZ5JBRI.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-DNWA7WNO.js";
|
|
24
24
|
import {
|
|
25
25
|
TRAIL_GOES_COLD
|
|
26
26
|
} from "./chunk-UU43WIZG.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-RFNLZM7W.js";
|
|
28
28
|
import "./chunk-CMUWRPSQ.js";
|
|
29
29
|
import {
|
|
30
30
|
Diagnostics,
|
|
31
31
|
bail,
|
|
32
|
+
compareText,
|
|
32
33
|
error,
|
|
33
34
|
isCapturing,
|
|
34
35
|
warn,
|
|
35
36
|
warning
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
compareText
|
|
39
|
-
} from "./chunk-VJWQSYEG.js";
|
|
37
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
40
38
|
import "./chunk-I3PS26CI.js";
|
|
41
39
|
|
|
42
40
|
// src/modules/links.ts
|
|
@@ -296,7 +294,7 @@ function find(output, urlPath, written) {
|
|
|
296
294
|
const index = path.join(base, "index.html");
|
|
297
295
|
return there(index) ? index : void 0;
|
|
298
296
|
}
|
|
299
|
-
function redirectSources(output) {
|
|
297
|
+
function redirectSources(output, base) {
|
|
300
298
|
let text;
|
|
301
299
|
try {
|
|
302
300
|
text = fs.readFileSync(path.join(output, "_redirects"), "utf8");
|
|
@@ -308,7 +306,7 @@ function redirectSources(output) {
|
|
|
308
306
|
const l = trim(line);
|
|
309
307
|
if (l === "" || l.startsWith("#")) continue;
|
|
310
308
|
const from = firstWord(l);
|
|
311
|
-
if (from !== void 0 && from.startsWith("/")) sources.push(from);
|
|
309
|
+
if (from !== void 0 && from.startsWith("/")) sources.push(inSite(from, base) ?? from);
|
|
312
310
|
}
|
|
313
311
|
return sources;
|
|
314
312
|
}
|
|
@@ -360,7 +358,7 @@ async function check(config, output, written, options) {
|
|
|
360
358
|
const origin = (options.url === void 0 ? void 0 : originOf(options.url)) ?? sitemapOrigin(output);
|
|
361
359
|
const ids = new Map(scans.map(([file, scan]) => [file, scan.ids]));
|
|
362
360
|
const writtenFiles = new Set(written);
|
|
363
|
-
const redirects = redirectSources(output);
|
|
361
|
+
const redirects = redirectSources(output, config.base);
|
|
364
362
|
const anchors = options.anchors ?? true;
|
|
365
363
|
let checked = 0;
|
|
366
364
|
const seen = /* @__PURE__ */ new Set();
|
package/lib/minify.js
CHANGED
|
@@ -2,28 +2,27 @@ 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-DUGGZ4EE.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
RustPlugin,
|
|
9
9
|
compilePlugin
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-P2TRR6XK.js";
|
|
11
|
+
import "./chunk-ERNVEZOK.js";
|
|
12
|
+
import "./chunk-MDB3D3LP.js";
|
|
13
13
|
import "./chunk-AD3HAW3W.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-BXARVN5Z.js";
|
|
15
|
+
import "./chunk-IOXCGMSF.js";
|
|
16
16
|
import {
|
|
17
17
|
closest
|
|
18
18
|
} from "./chunk-FVZ5JBRI.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-DNWA7WNO.js";
|
|
20
20
|
import "./chunk-UU43WIZG.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-RFNLZM7W.js";
|
|
22
22
|
import "./chunk-CMUWRPSQ.js";
|
|
23
23
|
import {
|
|
24
24
|
BuildError
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-VJWQSYEG.js";
|
|
25
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
27
26
|
import "./chunk-I3PS26CI.js";
|
|
28
27
|
|
|
29
28
|
// src/modules/minify.ts
|
package/lib/redirects.js
CHANGED
|
@@ -2,34 +2,32 @@ 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-DUGGZ4EE.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
debugString,
|
|
9
9
|
escapeHtml,
|
|
10
10
|
withBase
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-P2TRR6XK.js";
|
|
12
|
+
import "./chunk-ERNVEZOK.js";
|
|
13
|
+
import "./chunk-MDB3D3LP.js";
|
|
14
14
|
import "./chunk-AD3HAW3W.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-BXARVN5Z.js";
|
|
16
|
+
import "./chunk-IOXCGMSF.js";
|
|
17
17
|
import "./chunk-FVZ5JBRI.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-DNWA7WNO.js";
|
|
19
19
|
import "./chunk-UU43WIZG.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-RFNLZM7W.js";
|
|
21
21
|
import "./chunk-CMUWRPSQ.js";
|
|
22
22
|
import {
|
|
23
23
|
bail,
|
|
24
|
-
context
|
|
25
|
-
} from "./chunk-GRWMGC7D.js";
|
|
26
|
-
import {
|
|
27
24
|
compareText,
|
|
25
|
+
context,
|
|
28
26
|
displayPath,
|
|
29
27
|
isInside,
|
|
30
28
|
relative,
|
|
31
29
|
slashes
|
|
32
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
33
31
|
import "./chunk-I3PS26CI.js";
|
|
34
32
|
|
|
35
33
|
// src/modules/redirects.ts
|
|
@@ -140,7 +138,7 @@ BUILTINS.set("ssqch/redirects", (config, given) => {
|
|
|
140
138
|
const target = withBase(config2.base, to);
|
|
141
139
|
files.push({ path, contents: redirectPage(target), hook: { name: "redirect", value: { from, to: target } } });
|
|
142
140
|
}
|
|
143
|
-
lines += `${from} ${to} 301
|
|
141
|
+
lines += `${withBase(config2.base, from)} ${withBase(config2.base, to)} 301
|
|
144
142
|
`;
|
|
145
143
|
}
|
|
146
144
|
if (netlify && lines !== "") files.push({ path: "/_redirects", contents: lines, append: true });
|
package/lib/rss.js
CHANGED
|
@@ -2,29 +2,29 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
feedImages
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3NDFUMV2.js";
|
|
6
6
|
import {
|
|
7
7
|
Options
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DUGGZ4EE.js";
|
|
9
9
|
import {
|
|
10
10
|
BUILTINS,
|
|
11
|
-
rewriteHtml
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
rewriteHtml,
|
|
12
|
+
withBaseOnce
|
|
13
|
+
} from "./chunk-P2TRR6XK.js";
|
|
14
|
+
import "./chunk-ERNVEZOK.js";
|
|
15
|
+
import "./chunk-MDB3D3LP.js";
|
|
15
16
|
import "./chunk-AD3HAW3W.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-BXARVN5Z.js";
|
|
18
|
+
import "./chunk-IOXCGMSF.js";
|
|
18
19
|
import "./chunk-FVZ5JBRI.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-DNWA7WNO.js";
|
|
20
21
|
import "./chunk-UU43WIZG.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RFNLZM7W.js";
|
|
22
23
|
import "./chunk-CMUWRPSQ.js";
|
|
23
24
|
import {
|
|
24
25
|
bail,
|
|
25
26
|
toDate
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-VJWQSYEG.js";
|
|
27
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
28
28
|
import "./chunk-I3PS26CI.js";
|
|
29
29
|
|
|
30
30
|
// src/modules/rss.ts
|
|
@@ -69,15 +69,15 @@ function year(d) {
|
|
|
69
69
|
if (y < 0) return `-${String(-y).padStart(4, "0")}`;
|
|
70
70
|
return y > 9999 ? `+${y}` : String(y).padStart(4, "0");
|
|
71
71
|
}
|
|
72
|
-
function absoluteUrl(url, base) {
|
|
73
|
-
const text = String(url);
|
|
72
|
+
function absoluteUrl(url, base, siteBase = "") {
|
|
73
|
+
const text = withBaseOnce(siteBase, String(url));
|
|
74
74
|
try {
|
|
75
75
|
return new URL(text, String(base)).toString();
|
|
76
76
|
} catch {
|
|
77
77
|
return text;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function htmlToAbsoluteUrls(html, base) {
|
|
80
|
+
function htmlToAbsoluteUrls(html, base, siteBase = "") {
|
|
81
81
|
const baseUrl = String(base);
|
|
82
82
|
return rewriteHtml(String(html ?? ""), {
|
|
83
83
|
tag(el) {
|
|
@@ -85,25 +85,25 @@ function htmlToAbsoluteUrls(html, base) {
|
|
|
85
85
|
const v = el.get(attr);
|
|
86
86
|
if (v === void 0) continue;
|
|
87
87
|
if (attr !== "srcset") {
|
|
88
|
-
el.set(attr, absoluteUrl(v, baseUrl));
|
|
88
|
+
el.set(attr, absoluteUrl(v, baseUrl, siteBase));
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
91
|
const candidates = v.split(",").map((c) => {
|
|
92
92
|
const candidate = c.trim();
|
|
93
93
|
const space = candidate.indexOf(" ");
|
|
94
|
-
return space === -1 ? absoluteUrl(candidate, baseUrl) : `${absoluteUrl(candidate.slice(0, space), baseUrl)} ${candidate.slice(space + 1)}`;
|
|
94
|
+
return space === -1 ? absoluteUrl(candidate, baseUrl, siteBase) : `${absoluteUrl(candidate.slice(0, space), baseUrl, siteBase)} ${candidate.slice(space + 1)}`;
|
|
95
95
|
});
|
|
96
96
|
el.set(attr, candidates.join(", "));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
function feedHtml(html, base, options) {
|
|
101
|
+
function feedHtml(html, base, options, siteBase = "") {
|
|
102
102
|
const feedImages2 = feedImages;
|
|
103
103
|
if (typeof feedImages2 !== "function") bail("feedHtml() isn't in the Node build of ssqch yet (the move to Node, stage 5)");
|
|
104
104
|
const source = html === void 0 || html === null ? "" : String(html);
|
|
105
105
|
const done = feedImages2(source, String(base), options);
|
|
106
|
-
return typeof done === "string" ? htmlToAbsoluteUrls(done, base) : done.then((h) => htmlToAbsoluteUrls(h, base));
|
|
106
|
+
return typeof done === "string" ? htmlToAbsoluteUrls(done, base, siteBase) : done.then((h) => htmlToAbsoluteUrls(h, base, siteBase));
|
|
107
107
|
}
|
|
108
108
|
BUILTINS.set("ssqch/rss", (config, options) => {
|
|
109
109
|
new Options(options, []);
|
|
@@ -111,15 +111,15 @@ BUILTINS.set("ssqch/rss", (config, options) => {
|
|
|
111
111
|
filters.set("getNewestCollectionItemDate", (items) => getNewestCollectionItemDate(items));
|
|
112
112
|
filters.set("dateToRfc3339", (date) => dateToRfc3339(date));
|
|
113
113
|
filters.set("dateToRfc822", (date) => dateToRfc822(date));
|
|
114
|
-
filters.set("absoluteUrl", (url, base) => absoluteUrl(output(url), output(base)));
|
|
115
|
-
filters.set("htmlToAbsoluteUrls", (html, base) => htmlToAbsoluteUrls(output(html), output(base)));
|
|
114
|
+
filters.set("absoluteUrl", (url, base) => absoluteUrl(output(url), output(base), config.base));
|
|
115
|
+
filters.set("htmlToAbsoluteUrls", (html, base) => htmlToAbsoluteUrls(output(html), output(base), config.base));
|
|
116
116
|
const unprefixed = (e) => {
|
|
117
117
|
if (e instanceof Error && e.message.startsWith("feedHtml(): ")) e.message = e.message.slice("feedHtml(): ".length);
|
|
118
118
|
return e;
|
|
119
119
|
};
|
|
120
120
|
filters.set("feedHtml", (html, base, options2) => {
|
|
121
121
|
try {
|
|
122
|
-
const done = feedHtml(html, base, options2);
|
|
122
|
+
const done = feedHtml(html, base, options2, config.base);
|
|
123
123
|
return typeof done === "string" ? done : done.catch((e) => {
|
|
124
124
|
throw unprefixed(e);
|
|
125
125
|
});
|
package/lib/sass.js
CHANGED
|
@@ -5,37 +5,35 @@ import {
|
|
|
5
5
|
} from "./chunk-3NYSSA2C.js";
|
|
6
6
|
import {
|
|
7
7
|
Options
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DUGGZ4EE.js";
|
|
9
9
|
import {
|
|
10
10
|
BUILTINS,
|
|
11
11
|
cssWithBase,
|
|
12
12
|
debugString,
|
|
13
13
|
wasi
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-P2TRR6XK.js";
|
|
15
|
+
import "./chunk-ERNVEZOK.js";
|
|
16
|
+
import "./chunk-MDB3D3LP.js";
|
|
17
17
|
import "./chunk-AD3HAW3W.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-BXARVN5Z.js";
|
|
19
19
|
import {
|
|
20
20
|
WebAssembly
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IOXCGMSF.js";
|
|
22
22
|
import "./chunk-FVZ5JBRI.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-DNWA7WNO.js";
|
|
24
24
|
import "./chunk-UU43WIZG.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-RFNLZM7W.js";
|
|
26
26
|
import "./chunk-CMUWRPSQ.js";
|
|
27
27
|
import {
|
|
28
28
|
BuildError,
|
|
29
29
|
bail,
|
|
30
|
-
messageOf
|
|
31
|
-
} from "./chunk-GRWMGC7D.js";
|
|
32
|
-
import {
|
|
33
30
|
comparePaths,
|
|
34
31
|
displayPath,
|
|
35
32
|
isInside,
|
|
33
|
+
messageOf,
|
|
36
34
|
realPath,
|
|
37
35
|
slashes
|
|
38
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
39
37
|
import "./chunk-I3PS26CI.js";
|
|
40
38
|
|
|
41
39
|
// src/modules/sass.ts
|
package/lib/sitemap.js
CHANGED
|
@@ -2,32 +2,30 @@ 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-DUGGZ4EE.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
debugString,
|
|
9
9
|
escapeHtml,
|
|
10
10
|
isoDay
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-P2TRR6XK.js";
|
|
12
|
+
import "./chunk-ERNVEZOK.js";
|
|
13
|
+
import "./chunk-MDB3D3LP.js";
|
|
14
14
|
import "./chunk-AD3HAW3W.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-BXARVN5Z.js";
|
|
16
|
+
import "./chunk-IOXCGMSF.js";
|
|
17
17
|
import "./chunk-FVZ5JBRI.js";
|
|
18
18
|
import {
|
|
19
19
|
globSet
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DNWA7WNO.js";
|
|
21
21
|
import "./chunk-UU43WIZG.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RFNLZM7W.js";
|
|
23
23
|
import "./chunk-CMUWRPSQ.js";
|
|
24
24
|
import {
|
|
25
25
|
bail,
|
|
26
|
+
compareText,
|
|
26
27
|
toDate
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import {
|
|
29
|
-
compareText
|
|
30
|
-
} from "./chunk-VJWQSYEG.js";
|
|
28
|
+
} from "./chunk-JFPLNHEQ.js";
|
|
31
29
|
import "./chunk-I3PS26CI.js";
|
|
32
30
|
|
|
33
31
|
// src/modules/sitemap.ts
|
package/lib/ssqch.js
CHANGED
|
@@ -8,14 +8,13 @@ import {
|
|
|
8
8
|
readData,
|
|
9
9
|
slugger,
|
|
10
10
|
slugify
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IOXCGMSF.js";
|
|
12
12
|
import "./chunk-FVZ5JBRI.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-DNWA7WNO.js";
|
|
14
14
|
import "./chunk-UU43WIZG.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-RFNLZM7W.js";
|
|
16
16
|
import "./chunk-CMUWRPSQ.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-VJWQSYEG.js";
|
|
17
|
+
import "./chunk-JFPLNHEQ.js";
|
|
19
18
|
import "./chunk-I3PS26CI.js";
|
|
20
19
|
export {
|
|
21
20
|
api_default as default,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ssqch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "SiteSquatch (ssqch): a fast static site generator, configured with JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static site generator",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"liquid",
|
|
13
13
|
"edge"
|
|
14
14
|
],
|
|
15
|
-
"homepage": "https://
|
|
15
|
+
"homepage": "https://sitesquatch.dev",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
18
|
"url": "git+https://github.com/reverentgeek/sitesquatch.git",
|
package/types/index.d.ts
CHANGED
|
@@ -113,8 +113,13 @@ export interface BuildEvent {
|
|
|
113
113
|
type MaybePromise<T> = T | Promise<T>;
|
|
114
114
|
/** A function, or `{ run: "command" }` to run a program in the project root (through `sh -c`, or `cmd /C` on Windows). It gets `SSQCH_ENV`, `SSQCH_SERVING`, `SSQCH_QUIET`, `SSQCH_INPUT` and `SSQCH_OUTPUT`; a failure fails the build. */
|
|
115
115
|
type Hook = ((event: BuildEvent) => MaybePromise<void>) | { run: string };
|
|
116
|
-
/**
|
|
117
|
-
|
|
116
|
+
/** What a site's own engine is rendering, its third argument: a page's body, a layout, a Markdown render hook, or a page's `permalink` or `computed` string; and the file, as `page.inputPath` names it (`./src/posts/pine.md`). */
|
|
117
|
+
interface EngineContext {
|
|
118
|
+
kind: "body" | "layout" | "hook" | "permalink" | "computed";
|
|
119
|
+
path: string;
|
|
120
|
+
}
|
|
121
|
+
/** Renders a template's body (front matter removed) with the page's data. The third argument says what's being rendered. */
|
|
122
|
+
type EngineRender = (source: string, data: Record<string, any>, context: EngineContext) => MaybePromise<string>;
|
|
118
123
|
|
|
119
124
|
/**
|
|
120
125
|
* A field's type: `"string"`, `"number"`, `"integer"`, `"boolean"`, `"date"`, `"file"` (a path to a file that exists), `"object"`, `"array"` or `"any"`;
|
|
@@ -226,6 +231,8 @@ export interface Config extends ConfigParts {
|
|
|
226
231
|
strict?: boolean;
|
|
227
232
|
/** `page.lastModified`: `"git"` for the last commit that changed the page's file (its modification time when it has uncommitted changes), or `"file"` for the modification time. Off by default. Needs the full history in CI (`fetch-depth: 0`). */
|
|
228
233
|
lastModified?: "git" | "file" | false;
|
|
234
|
+
/** The date of a page with no date of its own (in its data or its file name): `"git"` for the last commit that changed its file, the same in every checkout, or `"file"` (the default) for the file's modification time, which is when the checkout wrote it. Either way it sorts after the dated pages, by path. Needs the full history in CI (`fetch-depth: 0`). */
|
|
235
|
+
dateFallback?: "git" | "file";
|
|
229
236
|
/** The time zone the site's own JavaScript runs in, as an IANA name (`"UTC"`, `"America/New_York"`): `Date`'s local methods and libraries like luxon and date-fns, in data files, filters, hooks and Edge templates, so a laptop and CI build the same pages. ssqch's own date filters are UTC whatever this says. Default: the machine's. The config's own top-level code runs before it applies. */
|
|
230
237
|
timeZone?: string;
|
|
231
238
|
/** The path the site is served under, when that isn't the root of its domain: `"/repo/"` for `https://you.github.io/repo/`. Templates and `page.url` stay as they are; ssqch adds the base to URLs from the site's root in the HTML it writes. Use the `withBase()` filter outside HTML attributes. */
|
package/types/rss.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function getNewestCollectionItemDate(collection: unknown[]): Date | undef
|
|
|
10
10
|
export function dateToRfc3339(date: Date | string): string;
|
|
11
11
|
/** A date as RFC 822 (`Sat, 01 Jun 2024 00:00:00 +0000`), for RSS feeds. */
|
|
12
12
|
export function dateToRfc822(date: Date | string): string;
|
|
13
|
-
/** A URL made absolute against the site's address: `absoluteUrl(post.url, "https://example.com")`. */
|
|
13
|
+
/** A URL made absolute against the site's address: `absoluteUrl(post.url, "https://example.com")`. As a template filter, it puts the site's `base` in front of a URL from the root that doesn't have it yet; called from code, it resolves as `new URL(url, base)` does. */
|
|
14
14
|
export function absoluteUrl(url: string, base: string): string;
|
|
15
15
|
/** Every link and image in some HTML made absolute, for a feed's content. */
|
|
16
16
|
export function htmlToAbsoluteUrls(html: string, base: string): string;
|