ssqch 0.8.0 → 0.9.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.
Files changed (52) hide show
  1. package/README.md +2 -0
  2. package/bundled/README.md +144 -77
  3. package/bundled/ssqch.d.ts +17 -9
  4. package/bundled/trailheads/from-jekyll.md +79 -0
  5. package/lib/assets.js +7 -7
  6. package/lib/{chunk-RI2L3VGO.js → chunk-3A647I3N.js} +19 -11
  7. package/lib/{chunk-AMBFWPZ4.js → chunk-3K3ANWZ2.js} +3 -3
  8. package/lib/{chunk-WMOVCQO6.js → chunk-47P4YREZ.js} +6 -6
  9. package/lib/{chunk-C35KIPAR.js → chunk-76NTVE34.js} +98 -7
  10. package/lib/{chunk-TWCVHOKO.js → chunk-7PWCYHTJ.js} +125 -4
  11. package/lib/{chunk-JSPSMIJ2.js → chunk-7RDRZHJD.js} +9 -9
  12. package/lib/{chunk-JRT7TQQP.js → chunk-7SD7K567.js} +1 -1
  13. package/lib/{chunk-IRHRK7XB.js → chunk-7XLK2GEG.js} +1 -1
  14. package/lib/{chunk-YSH2NMIE.js → chunk-BEGC7YP6.js} +6 -6
  15. package/lib/{chunk-HR2RU2LY.js → chunk-CZ4XQC56.js} +6 -6
  16. package/lib/{chunk-DHHQKW4F.js → chunk-D2XE2GTY.js} +7 -7
  17. package/lib/{chunk-BOBPVAX2.js → chunk-DELWRJAO.js} +373 -52
  18. package/lib/{chunk-6XYSFG6V.js → chunk-GRWMGC7D.js} +15 -3
  19. package/lib/{chunk-N5QTGQ5N.js → chunk-GUKSZ2XM.js} +1 -1
  20. package/lib/{chunk-TDGBQNGW.js → chunk-HPXAZ2HU.js} +1 -1
  21. package/lib/{chunk-3PHCFZEU.js → chunk-II5DEH3Q.js} +2 -2
  22. package/lib/{chunk-FYGE634X.js → chunk-IJWHOFRP.js} +9 -9
  23. package/lib/{chunk-UGEGUUBT.js → chunk-LPHNACE4.js} +8 -8
  24. package/lib/{chunk-KBGE5MCY.js → chunk-MI6EJWA2.js} +1 -1
  25. package/lib/{chunk-EIT4ZDT4.js → chunk-NCWFYT74.js} +61 -5
  26. package/lib/{chunk-VVPZ5PDP.js → chunk-NNUKIGOO.js} +11 -11
  27. package/lib/{chunk-TN6EEDX2.js → chunk-R7K3D5W5.js} +28 -6
  28. package/lib/{chunk-37KSIVNY.js → chunk-RNJFPFXE.js} +3 -3
  29. package/lib/{chunk-CDEPYU7W.js → chunk-SF4I6Z7S.js} +2 -2
  30. package/lib/{chunk-GSKVRAHF.js → chunk-SURPOAW7.js} +6 -6
  31. package/lib/{chunk-BRK4MXXO.js → chunk-SXMJ52IK.js} +18 -11
  32. package/lib/{chunk-EZZUUPI4.js → chunk-TICWN55Z.js} +2 -2
  33. package/lib/{chunk-NUKCUDC4.js → chunk-TVU3OPPK.js} +3 -3
  34. package/lib/{chunk-GOE4ZSAB.js → chunk-XMXBHXZR.js} +9 -9
  35. package/lib/{chunk-WP3RPVUM.js → chunk-YTHQBMDJ.js} +1 -1
  36. package/lib/cli.js +32 -25
  37. package/lib/elements.js +7 -7
  38. package/lib/image.js +8 -8
  39. package/lib/links.js +7 -7
  40. package/lib/minify.js +7 -7
  41. package/lib/redirects.js +7 -7
  42. package/lib/rss.js +8 -8
  43. package/lib/sass.js +45 -10
  44. package/lib/sitemap.js +36 -11
  45. package/lib/ssqch.js +4 -4
  46. package/package.json +1 -1
  47. package/types/image.d.ts +5 -5
  48. package/types/index.d.ts +10 -4
  49. package/types/sitemap.d.ts +2 -0
  50. package/wasm/markdown.wasm +0 -0
  51. /package/lib/{chunk-BOBPVAX2.js.LEGAL.txt → chunk-DELWRJAO.js.LEGAL.txt} +0 -0
  52. /package/lib/{chunk-6XYSFG6V.js.LEGAL.txt → chunk-GRWMGC7D.js.LEGAL.txt} +0 -0
@@ -3457,7 +3457,7 @@ var TABLE = [
3457
3457
  { word: "slug", kind: "filter", alias: false, from: ["Eleventy"], ssqch: "slugify", say: "ssqch's is `slugify`, which differs: Eleventy's `slug` (the `slugify` npm package) keeps `.` and some punctuation, so `Node.js` is `node.js` there and `node-js` in ssqch. To keep old URLs, define `slug` in `filters` with that package: slug: (s) => slugify(String(s), { lower: true }).", more: "ssqch docs slugify" },
3458
3458
  { word: "absolute_url", kind: "filter", alias: false, from: ["Jekyll"], ssqch: "absoluteUrl", say: '`absoluteUrl(url, base)` comes with `rssPlugin()` from "ssqch/rss".', more: "ssqch docs absoluteUrl" },
3459
3459
  { word: "markdownify", kind: "filter", alias: true, from: ["Jekyll", "Hugo"], ssqch: "markdown", say: 'ssqch\'s function is `markdown(text)` (or `markdown(text, "inline")`).', more: "ssqch docs markdown" },
3460
- { word: "jsonify", kind: "filter", alias: false, from: ["Jekyll"], ssqch: "dump", say: "Jinja's is `tojson` (`dump` in Nunjucks); Liquid's is `json`.", more: 'ssqch docs "Jinja and Nunjucks"' },
3460
+ { word: "jsonify", kind: "filter", alias: false, from: ["Jekyll"], ssqch: "dump", say: "`jsonify` works in Liquid templates; in Jinja it's `tojson`, and in Nunjucks `dump`.", more: 'ssqch docs "Jinja and Nunjucks"' },
3461
3461
  // Template globals: the word as it's written in template code.
3462
3462
  { word: "eleventy.", kind: "global", alias: false, from: ["Eleventy"], ssqch: "ssqch", say: "ssqch's is `ssqch`: `ssqch.generator`, `ssqch.version`, `ssqch.env` and `ssqch.serving`, so this prints nothing.", more: "ssqch docs ssqch.generator" },
3463
3463
  { word: "site.posts", kind: "global", alias: false, from: ["Jekyll"], ssqch: "collections", say: "ssqch's lists of pages are `collections`: `collections.posts` is the pages tagged `posts`, so this is empty.", more: "ssqch docs collections" },
@@ -3729,7 +3729,7 @@ function frames(e, fallback, at) {
3729
3729
  const found = [];
3730
3730
  for (const problem of fromError(e, fallback, at)) {
3731
3731
  const shown = frame(problem, at);
3732
- if (shown !== void 0) found.push(shown);
3732
+ if (shown !== void 0 && !found.includes(shown)) found.push(shown);
3733
3733
  if (found.length === 3) break;
3734
3734
  }
3735
3735
  return found.length ? found.join("\n\n") : void 0;
@@ -3823,6 +3823,16 @@ function printError(label, e, fallback, at) {
3823
3823
  }
3824
3824
 
3825
3825
  // src/data.ts
3826
+ function buildTime() {
3827
+ const epoch = sourceDateEpoch();
3828
+ return epoch === void 0 ? /* @__PURE__ */ new Date() : new Date(epoch);
3829
+ }
3830
+ function sourceDateEpoch() {
3831
+ const value = process.env.SOURCE_DATE_EPOCH;
3832
+ if (value === void 0 || value === "") return void 0;
3833
+ if (!/^\d+$/.test(value.trim())) throw new BuildError(`SOURCE_DATE_EPOCH must be whole seconds since 1970 (like 1767225600 for 2026-01-01), not "${value}"`);
3834
+ return Number(value.trim()) * 1e3;
3835
+ }
3826
3836
  var isPlainObject = (v) => {
3827
3837
  if (v === null || typeof v !== "object") return false;
3828
3838
  const proto = Object.getPrototypeOf(v);
@@ -4375,6 +4385,8 @@ function utcMs(y, mo, d, h = "0", mi = "0", s = "0", fraction) {
4375
4385
 
4376
4386
  export {
4377
4387
  TomlError,
4388
+ buildTime,
4389
+ sourceDateEpoch,
4378
4390
  isPlainObject,
4379
4391
  parseFrontMatter,
4380
4392
  tomlReason,
@@ -4420,4 +4432,4 @@ export {
4420
4432
  describe,
4421
4433
  printError
4422
4434
  };
4423
- /*! For license information please see chunk-6XYSFG6V.js.LEGAL.txt */
4435
+ /*! For license information please see chunk-GRWMGC7D.js.LEGAL.txt */
@@ -3,7 +3,7 @@ const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  warn,
5
5
  warning
6
- } from "./chunk-6XYSFG6V.js";
6
+ } from "./chunk-GRWMGC7D.js";
7
7
  import {
8
8
  compareText,
9
9
  realPath
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-CMUWRPSQ.js";
6
6
  import {
7
7
  bail
8
- } from "./chunk-6XYSFG6V.js";
8
+ } from "./chunk-GRWMGC7D.js";
9
9
 
10
10
  // src/glob.ts
11
11
  var stripDot = (p) => p.replace(/^(\.\/)+/, "");
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  BUDGETS
5
- } from "./chunk-IRHRK7XB.js";
5
+ } from "./chunk-7XLK2GEG.js";
6
6
  import {
7
7
  bytes,
8
8
  count,
@@ -16,7 +16,7 @@ import {
16
16
  BuildError,
17
17
  bail,
18
18
  warning
19
- } from "./chunk-6XYSFG6V.js";
19
+ } from "./chunk-GRWMGC7D.js";
20
20
  import {
21
21
  compareText,
22
22
  realPath
@@ -9,25 +9,25 @@ import {
9
9
  inspectPages,
10
10
  runCommand,
11
11
  sameContentsForTest
12
- } from "./chunk-BOBPVAX2.js";
12
+ } from "./chunk-DELWRJAO.js";
13
13
  import {
14
14
  commandLine,
15
15
  toolPath
16
16
  } from "./chunk-4Q6WMTER.js";
17
- import "./chunk-RI2L3VGO.js";
18
- import "./chunk-3PHCFZEU.js";
19
- import "./chunk-TN6EEDX2.js";
20
- import "./chunk-IRHRK7XB.js";
17
+ import "./chunk-3A647I3N.js";
18
+ import "./chunk-II5DEH3Q.js";
19
+ import "./chunk-R7K3D5W5.js";
20
+ import "./chunk-7XLK2GEG.js";
21
21
  import "./chunk-NKXEPHRZ.js";
22
22
  import "./chunk-AD3HAW3W.js";
23
23
  import "./chunk-DDV6JEC2.js";
24
- import "./chunk-EIT4ZDT4.js";
24
+ import "./chunk-NCWFYT74.js";
25
25
  import "./chunk-FVZ5JBRI.js";
26
- import "./chunk-TDGBQNGW.js";
26
+ import "./chunk-HPXAZ2HU.js";
27
27
  import "./chunk-UU43WIZG.js";
28
- import "./chunk-C35KIPAR.js";
28
+ import "./chunk-76NTVE34.js";
29
29
  import "./chunk-CMUWRPSQ.js";
30
- import "./chunk-6XYSFG6V.js";
30
+ import "./chunk-GRWMGC7D.js";
31
31
  import "./chunk-VJWQSYEG.js";
32
32
  import "./chunk-I3PS26CI.js";
33
33
  export {
@@ -5,20 +5,20 @@ import {
5
5
  capabilities,
6
6
  modules,
7
7
  runCapabilities
8
- } from "./chunk-AMBFWPZ4.js";
9
- import "./chunk-WP3RPVUM.js";
10
- import "./chunk-TN6EEDX2.js";
11
- import "./chunk-IRHRK7XB.js";
8
+ } from "./chunk-3K3ANWZ2.js";
9
+ import "./chunk-YTHQBMDJ.js";
10
+ import "./chunk-R7K3D5W5.js";
11
+ import "./chunk-7XLK2GEG.js";
12
12
  import "./chunk-NKXEPHRZ.js";
13
13
  import "./chunk-AD3HAW3W.js";
14
14
  import "./chunk-DDV6JEC2.js";
15
- import "./chunk-EIT4ZDT4.js";
15
+ import "./chunk-NCWFYT74.js";
16
16
  import "./chunk-FVZ5JBRI.js";
17
- import "./chunk-TDGBQNGW.js";
17
+ import "./chunk-HPXAZ2HU.js";
18
18
  import "./chunk-UU43WIZG.js";
19
- import "./chunk-C35KIPAR.js";
19
+ import "./chunk-76NTVE34.js";
20
20
  import "./chunk-CMUWRPSQ.js";
21
- import "./chunk-6XYSFG6V.js";
21
+ import "./chunk-GRWMGC7D.js";
22
22
  import "./chunk-VJWQSYEG.js";
23
23
  import "./chunk-I3PS26CI.js";
24
24
  export {
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  red
5
- } from "./chunk-6XYSFG6V.js";
5
+ } from "./chunk-GRWMGC7D.js";
6
6
 
7
7
  // src/serve/builder.ts
8
8
  import { fork } from "node:child_process";
@@ -8,7 +8,7 @@ import {
8
8
  globProblem,
9
9
  globToRegExp,
10
10
  isGlob
11
- } from "./chunk-TDGBQNGW.js";
11
+ } from "./chunk-HPXAZ2HU.js";
12
12
  import {
13
13
  ISSUES_URL,
14
14
  SOMETHING_LARGE
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  describeThrown,
18
18
  settle
19
- } from "./chunk-C35KIPAR.js";
19
+ } from "./chunk-76NTVE34.js";
20
20
  import {
21
21
  BuildError,
22
22
  Diagnostics,
@@ -29,7 +29,7 @@ import {
29
29
  readText,
30
30
  warn,
31
31
  warning
32
- } from "./chunk-6XYSFG6V.js";
32
+ } from "./chunk-GRWMGC7D.js";
33
33
  import {
34
34
  comparePaths
35
35
  } from "./chunk-VJWQSYEG.js";
@@ -179,6 +179,8 @@ var WasmMarkdown = class {
179
179
  return status === DONE ? text : "";
180
180
  }
181
181
  useHooks(hooks, engines) {
182
+ const own = hooks.get("containers/slot");
183
+ if (own) throw new BuildError(`${own.name}: \`slot\` is ssqch's container for a named slot (\`::: slot footer\` inside another container is its \`container.slots.footer\`), so it can't have a template. Rename the container`);
182
184
  this.#hooks = hooks;
183
185
  this.#engines = engines;
184
186
  this.close();
@@ -213,7 +215,7 @@ var WasmMarkdown = class {
213
215
  const [status, text, thrown] = wasm.run(frame, () => wasm.x.md_render(this.#handle, ptr, lens[0], lens[1], flags), file);
214
216
  this.#waited(frame, what);
215
217
  if (status !== DONE) throw failure(text, thrown);
216
- return text;
218
+ return putBackSlots(text);
217
219
  }
218
220
  /** A render that runs nothing of the site's: the calls to its functions it would make, in order. */
219
221
  #dryRun(source, file) {
@@ -325,7 +327,8 @@ var WasmMarkdown = class {
325
327
  highlightCss: o.highlightCss,
326
328
  languages,
327
329
  headingIdsFunction: o.sluggerFn ? number(o.sluggerFn, "markdown.headingIds", true) : null,
328
- hooks: [...this.#hooks.keys()],
330
+ // `slot` is ssqch's container: it always calls back, to be kept for its parent.
331
+ hooks: [...this.#hooks.keys(), "containers/slot"],
329
332
  languagesKey: JSON.stringify(key)
330
333
  });
331
334
  return { json, files: files2 };
@@ -335,6 +338,12 @@ var WasmMarkdown = class {
335
338
  }
336
339
  /** A render hook for the wasm: the template `name` with the page's data and `value` as `key`. */
337
340
  renderHook(name, key, value, data) {
341
+ if (key === "container" && isPlainObject(value)) {
342
+ if (name === "containers/slot") return keepSlot(value);
343
+ const own = { ...value, props: containerProps(value.args) };
344
+ own.slots = takeSlots(own);
345
+ value = own;
346
+ }
338
347
  const template = this.#hooks.get(name);
339
348
  const engines = this.#engines;
340
349
  if (!template || !engines) throw new BuildError(`no template for \`${name}\``);
@@ -386,6 +395,53 @@ var WasmMarkdown = class {
386
395
  return describeThrown(e, this.#root);
387
396
  }
388
397
  };
398
+ function containerProps(args) {
399
+ const props = {};
400
+ for (const [, name, dq, sq, bare] of String(args ?? "").matchAll(/([A-Za-z_][\w-]*)(?:="([^"]*)"|='([^']*)'|=([^\s"']+))?/g)) {
401
+ if (dq !== void 0) props[name] = dq;
402
+ else if (sq !== void 0) {
403
+ if (/^\s*[{[]/.test(sq)) {
404
+ try {
405
+ props[name] = JSON.parse(sq);
406
+ continue;
407
+ } catch {
408
+ }
409
+ }
410
+ props[name] = sq;
411
+ } else if (bare !== void 0) props[name] = bare;
412
+ else props[name] = true;
413
+ }
414
+ return props;
415
+ }
416
+ var slots = /* @__PURE__ */ new Map();
417
+ var slotCount = 0;
418
+ var SLOT = /\uE000slot(\d+)\uE001\n?/g;
419
+ function keepSlot(value) {
420
+ const props = containerProps(value.args);
421
+ const name = typeof props.name === "string" ? props.name : String(value.args ?? "").trim().split(/\s+/)[0] || "default";
422
+ const n = slotCount++;
423
+ slots.set(n, { name, content: String(value.content ?? "") });
424
+ return `\uE000slot${n}\uE001`;
425
+ }
426
+ function takeSlots(value) {
427
+ const found = {};
428
+ if (typeof value.content !== "string" || !value.content.includes("\uE000slot")) return found;
429
+ value.content = value.content.replace(SLOT, (_, n) => {
430
+ const slot = slots.get(Number(n));
431
+ slots.delete(Number(n));
432
+ if (slot) found[slot.name] = String(found[slot.name] ?? "") + slot.content;
433
+ return "";
434
+ });
435
+ return found;
436
+ }
437
+ function putBackSlots(html) {
438
+ if (!html.includes("\uE000slot")) return html;
439
+ return html.replace(SLOT, (_, n) => {
440
+ const slot = slots.get(Number(n));
441
+ slots.delete(Number(n));
442
+ return slot?.content ?? "";
443
+ });
444
+ }
389
445
  var handles = new FinalizationRegistry(({ wasm, handle }) => {
390
446
  if (!wasm.dead) wasm.x.md_drop(handle);
391
447
  });
@@ -2,21 +2,21 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  isAsset
5
- } from "./chunk-N5QTGQ5N.js";
5
+ } from "./chunk-GUKSZ2XM.js";
6
6
  import {
7
7
  build
8
- } from "./chunk-BOBPVAX2.js";
8
+ } from "./chunk-DELWRJAO.js";
9
9
  import "./chunk-4Q6WMTER.js";
10
- import "./chunk-RI2L3VGO.js";
11
- import "./chunk-3PHCFZEU.js";
10
+ import "./chunk-3A647I3N.js";
11
+ import "./chunk-II5DEH3Q.js";
12
12
  import {
13
13
  filesRead
14
14
  } from "./chunk-3NYSSA2C.js";
15
15
  import {
16
16
  fileHash
17
- } from "./chunk-KBGE5MCY.js";
18
- import "./chunk-TN6EEDX2.js";
19
- import "./chunk-IRHRK7XB.js";
17
+ } from "./chunk-MI6EJWA2.js";
18
+ import "./chunk-R7K3D5W5.js";
19
+ import "./chunk-7XLK2GEG.js";
20
20
  import {
21
21
  summary
22
22
  } from "./chunk-NKXEPHRZ.js";
@@ -24,14 +24,14 @@ import "./chunk-AD3HAW3W.js";
24
24
  import {
25
25
  dirsOf
26
26
  } from "./chunk-DDV6JEC2.js";
27
- import "./chunk-EIT4ZDT4.js";
27
+ import "./chunk-NCWFYT74.js";
28
28
  import "./chunk-FVZ5JBRI.js";
29
- import "./chunk-TDGBQNGW.js";
29
+ import "./chunk-HPXAZ2HU.js";
30
30
  import "./chunk-UU43WIZG.js";
31
31
  import {
32
32
  describeThrown,
33
33
  loadedFiles
34
- } from "./chunk-C35KIPAR.js";
34
+ } from "./chunk-76NTVE34.js";
35
35
  import "./chunk-CMUWRPSQ.js";
36
36
  import {
37
37
  BuildError,
@@ -43,7 +43,7 @@ import {
43
43
  messageOf,
44
44
  printError,
45
45
  red
46
- } from "./chunk-6XYSFG6V.js";
46
+ } from "./chunk-GRWMGC7D.js";
47
47
  import {
48
48
  isInside,
49
49
  realPath,
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  budget
5
- } from "./chunk-IRHRK7XB.js";
5
+ } from "./chunk-7XLK2GEG.js";
6
6
  import {
7
7
  bytes,
8
8
  count
@@ -22,14 +22,14 @@ import {
22
22
  probeFile,
23
23
  site,
24
24
  undecodable
25
- } from "./chunk-EIT4ZDT4.js";
25
+ } from "./chunk-NCWFYT74.js";
26
26
  import {
27
27
  closest
28
28
  } from "./chunk-FVZ5JBRI.js";
29
29
  import {
30
30
  globProblem,
31
31
  globToRegExp
32
- } from "./chunk-TDGBQNGW.js";
32
+ } from "./chunk-HPXAZ2HU.js";
33
33
  import {
34
34
  describeThrown,
35
35
  hookModules,
@@ -37,7 +37,7 @@ import {
37
37
  loadedFiles,
38
38
  settle,
39
39
  watchSettle
40
- } from "./chunk-C35KIPAR.js";
40
+ } from "./chunk-76NTVE34.js";
41
41
  import {
42
42
  charCount,
43
43
  firstChars,
@@ -63,7 +63,7 @@ import {
63
63
  tomlReason,
64
64
  warn,
65
65
  warning
66
- } from "./chunk-6XYSFG6V.js";
66
+ } from "./chunk-GRWMGC7D.js";
67
67
  import {
68
68
  compareText,
69
69
  displayPath,
@@ -3302,6 +3302,7 @@ function emptyConfig(options) {
3302
3302
  bundles: false,
3303
3303
  strict: false,
3304
3304
  lastModified: null,
3305
+ timeZone: null,
3305
3306
  base: "",
3306
3307
  serveRun: [],
3307
3308
  budgets: [],
@@ -3309,6 +3310,7 @@ function emptyConfig(options) {
3309
3310
  themes: [],
3310
3311
  passthrough: [],
3311
3312
  filters: /* @__PURE__ */ new Map(),
3313
+ siteFilters: /* @__PURE__ */ new Set(),
3312
3314
  globalData: [],
3313
3315
  dataExtensions: /* @__PURE__ */ new Map(),
3314
3316
  collections: [],
@@ -3361,8 +3363,25 @@ async function loadConfig(options) {
3361
3363
  }
3362
3364
  }
3363
3365
  useImages(config);
3366
+ useTimeZone(config.timeZone);
3364
3367
  return config;
3365
3368
  }
3369
+ var MACHINE_TZ = process.env.TZ;
3370
+ function useTimeZone(zone) {
3371
+ const want = zone ?? MACHINE_TZ;
3372
+ if (process.env.TZ === want) return;
3373
+ if (want === void 0) delete process.env.TZ;
3374
+ else process.env.TZ = want;
3375
+ }
3376
+ function checkTimeZone(value) {
3377
+ if (typeof value !== "string" || value === "") bail(`timeZone must be a time zone's name, like "UTC" or "America/New_York", not ${typeof value === "string" ? "an empty string" : typeof value}`);
3378
+ try {
3379
+ new Intl.DateTimeFormat("en", { timeZone: value });
3380
+ } catch {
3381
+ bail(`timeZone: "${value}" isn't a time zone ssqch knows (like "UTC", "Europe/Berlin" or "America/New_York")`);
3382
+ }
3383
+ return value;
3384
+ }
3366
3385
  async function loadJsData(file, root) {
3367
3386
  const name = path7.relative(root, file).split(path7.sep).join("/");
3368
3387
  try {
@@ -3374,7 +3393,7 @@ async function loadJsData(file, root) {
3374
3393
  throw new BuildError(`${name}: ${describeThrown(e, root)}`);
3375
3394
  }
3376
3395
  }
3377
- var SETTINGS = ["dirs", "templateFormats", "markdownEngine", "htmlEngine", "markdown", "deepMerge", "leaveNoTrace", "clean", "ignore", "bundles", "strict", "lastModified", "base", "schemas", "theme", "serve", "budgets"];
3396
+ var SETTINGS = ["dirs", "templateFormats", "markdownEngine", "htmlEngine", "markdown", "deepMerge", "leaveNoTrace", "clean", "ignore", "bundles", "strict", "lastModified", "timeZone", "base", "schemas", "theme", "serve", "budgets"];
3378
3397
  var PARTS = ["data", "filters", "collections", "transforms", "engines", "passthrough", "watch", "beforeBuild", "afterBuild", "plugins"];
3379
3398
  var CORE_ENGINES = ["edge", "md", "html", "txt"];
3380
3399
  var DIRS = ["input", "output", "includes", "layouts", "data"];
@@ -3555,6 +3574,7 @@ async function loadJs(config, file) {
3555
3574
  claim("filters", "filter", key, where);
3556
3575
  ops.push(() => {
3557
3576
  config.filters.set(key, fn);
3577
+ config.siteFilters.add(key);
3558
3578
  });
3559
3579
  }
3560
3580
  for (const [key, run] of rust.engines) {
@@ -3590,6 +3610,7 @@ async function loadJs(config, file) {
3590
3610
  }
3591
3611
  functions("filters", "filter", part.filters, where, (key, fn) => ops.push(() => {
3592
3612
  config.filters.set(key, fn);
3613
+ config.siteFilters.add(key);
3593
3614
  }));
3594
3615
  functions("collections", "collection", part.collections, where, (key, fn) => ops.push(() => {
3595
3616
  config.collections.push([key, fn]);
@@ -3720,6 +3741,7 @@ function applySettings(config, settings) {
3720
3741
  else if (modified === "git" || modified === "file") config.lastModified = modified;
3721
3742
  else if (typeof modified === "string") bail(`lastModified must be "git", "file" or false, not "${modified}"`);
3722
3743
  else if (modified !== void 0 && modified !== null && modified !== false) bail(`lastModified must be "git", "file" or false, not ${typeof modified}`);
3744
+ if (settings.timeZone !== void 0 && settings.timeZone !== null) config.timeZone = checkTimeZone(settings.timeZone);
3723
3745
  if (typeof settings.base === "string") config.base = normalizeBase(settings.base);
3724
3746
  else if (settings.base !== void 0 && settings.base !== null) bail(`base must be a URL path like "/docs/", not ${typeof settings.base}`);
3725
3747
  const theme = settings.theme;
@@ -8,14 +8,14 @@ import {
8
8
  measure,
9
9
  overBudget,
10
10
  urlOf
11
- } from "./chunk-3PHCFZEU.js";
12
- import "./chunk-IRHRK7XB.js";
11
+ } from "./chunk-II5DEH3Q.js";
12
+ import "./chunk-7XLK2GEG.js";
13
13
  import "./chunk-NKXEPHRZ.js";
14
14
  import "./chunk-DDV6JEC2.js";
15
15
  import "./chunk-FVZ5JBRI.js";
16
16
  import "./chunk-UU43WIZG.js";
17
17
  import "./chunk-CMUWRPSQ.js";
18
- import "./chunk-6XYSFG6V.js";
18
+ import "./chunk-GRWMGC7D.js";
19
19
  import "./chunk-VJWQSYEG.js";
20
20
  import "./chunk-I3PS26CI.js";
21
21
  export {
@@ -9,8 +9,8 @@ import {
9
9
  starterEngines,
10
10
  starterFiles,
11
11
  write
12
- } from "./chunk-WP3RPVUM.js";
13
- import "./chunk-6XYSFG6V.js";
12
+ } from "./chunk-YTHQBMDJ.js";
13
+ import "./chunk-GRWMGC7D.js";
14
14
  import "./chunk-VJWQSYEG.js";
15
15
  import "./chunk-I3PS26CI.js";
16
16
  export {
@@ -8,8 +8,8 @@ import {
8
8
  loadConfig,
9
9
  meant,
10
10
  tomlKeyLine
11
- } from "./chunk-TN6EEDX2.js";
12
- import "./chunk-IRHRK7XB.js";
11
+ } from "./chunk-R7K3D5W5.js";
12
+ import "./chunk-7XLK2GEG.js";
13
13
  import "./chunk-NKXEPHRZ.js";
14
14
  import "./chunk-AD3HAW3W.js";
15
15
  import {
@@ -19,13 +19,13 @@ import {
19
19
  shownDir,
20
20
  shownOutput
21
21
  } from "./chunk-DDV6JEC2.js";
22
- import "./chunk-EIT4ZDT4.js";
22
+ import "./chunk-NCWFYT74.js";
23
23
  import "./chunk-FVZ5JBRI.js";
24
- import "./chunk-TDGBQNGW.js";
24
+ import "./chunk-HPXAZ2HU.js";
25
25
  import "./chunk-UU43WIZG.js";
26
- import "./chunk-C35KIPAR.js";
26
+ import "./chunk-76NTVE34.js";
27
27
  import "./chunk-CMUWRPSQ.js";
28
- import "./chunk-6XYSFG6V.js";
28
+ import "./chunk-GRWMGC7D.js";
29
29
  import "./chunk-VJWQSYEG.js";
30
30
  import "./chunk-I3PS26CI.js";
31
31
  export {
@@ -2,10 +2,10 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  modules
5
- } from "./chunk-AMBFWPZ4.js";
5
+ } from "./chunk-3K3ANWZ2.js";
6
6
  import {
7
7
  BUILTIN_FILTERS
8
- } from "./chunk-RI2L3VGO.js";
8
+ } from "./chunk-3A647I3N.js";
9
9
  import {
10
10
  longHelp
11
11
  } from "./chunk-F65YUXZ7.js";
@@ -14,30 +14,30 @@ import {
14
14
  bundled,
15
15
  bundledNames,
16
16
  types
17
- } from "./chunk-WP3RPVUM.js";
17
+ } from "./chunk-YTHQBMDJ.js";
18
18
  import {
19
19
  configOptions
20
- } from "./chunk-TN6EEDX2.js";
21
- import "./chunk-IRHRK7XB.js";
20
+ } from "./chunk-R7K3D5W5.js";
21
+ import "./chunk-7XLK2GEG.js";
22
22
  import "./chunk-NKXEPHRZ.js";
23
23
  import {
24
24
  VERSION
25
25
  } from "./chunk-AD3HAW3W.js";
26
26
  import "./chunk-DDV6JEC2.js";
27
- import "./chunk-EIT4ZDT4.js";
27
+ import "./chunk-NCWFYT74.js";
28
28
  import {
29
29
  closest
30
30
  } from "./chunk-FVZ5JBRI.js";
31
- import "./chunk-TDGBQNGW.js";
31
+ import "./chunk-HPXAZ2HU.js";
32
32
  import "./chunk-UU43WIZG.js";
33
- import "./chunk-C35KIPAR.js";
33
+ import "./chunk-76NTVE34.js";
34
34
  import "./chunk-CMUWRPSQ.js";
35
35
  import {
36
36
  OTHER_CONFIGS,
37
37
  TABLE,
38
38
  red,
39
39
  toJson
40
- } from "./chunk-6XYSFG6V.js";
40
+ } from "./chunk-GRWMGC7D.js";
41
41
  import "./chunk-VJWQSYEG.js";
42
42
  import "./chunk-I3PS26CI.js";
43
43
 
@@ -45,6 +45,7 @@ import "./chunk-I3PS26CI.js";
45
45
  var GUIDES_URL = "https://github.com/reverentgeek/sitesquatch/blob";
46
46
  var byteLength = (text) => Buffer.byteLength(text);
47
47
  var ALNUM = /[\p{Alphabetic}\p{N}]/u;
48
+ var IMAGE_LINE = /^\s*(<p\b[^>]*>\s*)?<img\b[^>]*>(\s*<\/p>)?\s*$/i;
48
49
  function sections(readme = bundled("README.md")) {
49
50
  const out = [];
50
51
  let fence = null;
@@ -55,6 +56,7 @@ function sections(readme = bundled("README.md")) {
55
56
  if (fence === null) fence = marker;
56
57
  else if (fence === marker && trimmed.trimEnd().replace(new RegExp(`^\\${marker[0]}+`), "") === "") fence = null;
57
58
  }
59
+ if (fence === null && marker === void 0 && IMAGE_LINE.test(line)) continue;
58
60
  const hashes = line.length - line.replace(/^#+/, "").length;
59
61
  if (fence === null && marker === void 0 && hashes >= 1 && hashes <= 4 && line[hashes] === " ") {
60
62
  out.push({ level: hashes, title: line.slice(hashes).trim(), body: "" });
@@ -227,15 +229,20 @@ function firstMention(block, name) {
227
229
  const at = mentionsAt(text, name)[0];
228
230
  return at === void 0 ? void 0 : byteLength(text.slice(0, at));
229
231
  }
232
+ function leadsWith(block, name) {
233
+ const lead = /^(?:[-*] )?\*\*([^*]+?):?\*\*/.exec(block)?.[1];
234
+ return lead !== void 0 && words(lead).join(" ") === words(name).join(" ");
235
+ }
230
236
  function passages(all, name) {
231
237
  let best;
232
238
  const defining = [];
233
239
  all.forEach((s, i) => {
234
240
  for (const block2 of blocks(s.body)) {
235
241
  const n = mentions(block2, name);
236
- if (n === 0) continue;
242
+ const leads = leadsWith(block2, name);
243
+ if (n === 0 && !leads) continue;
237
244
  const at = firstMention(block2, name);
238
- const defines = at !== void 0 && at < 60;
245
+ const defines = at !== void 0 && at < 60 || leads;
239
246
  if (defines) defining.push([i, block2]);
240
247
  const score = n + (defines ? 1e3 : 0) + mentions(s.title, name) * 100;
241
248
  if (best === void 0 || score > best[1]) best = [i, score, block2];
@@ -6,9 +6,9 @@ import {
6
6
  globSet,
7
7
  globToRegExp,
8
8
  isGlob
9
- } from "./chunk-TDGBQNGW.js";
9
+ } from "./chunk-HPXAZ2HU.js";
10
10
  import "./chunk-CMUWRPSQ.js";
11
- import "./chunk-6XYSFG6V.js";
11
+ import "./chunk-GRWMGC7D.js";
12
12
  import "./chunk-VJWQSYEG.js";
13
13
  import "./chunk-I3PS26CI.js";
14
14
  export {
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  Options
5
- } from "./chunk-JRT7TQQP.js";
5
+ } from "./chunk-7SD7K567.js";
6
6
  import {
7
7
  BUILTINS,
8
8
  addImagePlugin,
@@ -11,10 +11,10 @@ import {
11
11
  imageOptionsFor,
12
12
  meant,
13
13
  parseFormat
14
- } from "./chunk-TN6EEDX2.js";
14
+ } from "./chunk-R7K3D5W5.js";
15
15
  import {
16
16
  bail
17
- } from "./chunk-6XYSFG6V.js";
17
+ } from "./chunk-GRWMGC7D.js";
18
18
 
19
19
  // src/modules/image.ts
20
20
  import fs from "node:fs";