@dogsbay/ssg 0.2.0-beta.133 → 0.2.0-beta.135

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.
@@ -1,31 +1,31 @@
1
1
  Third-party software in @dogsbay/ssg (dist/package/)
2
2
 
3
3
  ========================================================================
4
- @dogsbay/elements@0.2.0-beta.133 (MIT)
4
+ @dogsbay/elements@0.2.0-beta.135 (MIT)
5
5
  https://github.com/dogsbay/dogsbay.git
6
6
 
7
7
  Licensed under MIT; the package ships no licence file.
8
8
 
9
9
  ========================================================================
10
- @dogsbay/primitives@0.2.0-beta.133 (MIT)
10
+ @dogsbay/primitives@0.2.0-beta.135 (MIT)
11
11
  https://github.com/dogsbay/dogsbay.git
12
12
 
13
13
  Licensed under MIT; the package ships no licence file.
14
14
 
15
15
  ========================================================================
16
- @dogsbay/render-html@0.2.0-beta.133 (MIT)
16
+ @dogsbay/render-html@0.2.0-beta.135 (MIT)
17
17
  https://github.com/dogsbay/dogsbay.git
18
18
 
19
19
  Licensed under MIT; the package ships no licence file.
20
20
 
21
21
  ========================================================================
22
- @dogsbay/search@0.2.0-beta.133 (MIT)
22
+ @dogsbay/search@0.2.0-beta.135 (MIT)
23
23
  https://github.com/dogsbay/dogsbay.git
24
24
 
25
25
  Licensed under MIT; the package ships no licence file.
26
26
 
27
27
  ========================================================================
28
- @dogsbay/ui@0.2.0-beta.133 (MIT)
28
+ @dogsbay/ui@0.2.0-beta.135 (MIT)
29
29
  https://github.com/dogsbay/dogsbay.git
30
30
 
31
31
  Licensed under MIT; the package ships no licence file.
@@ -1072,31 +1072,31 @@ var CLIENT_CANDIDATES = ['""', '"&"', '"\\\\$&")).join("|")})', '"\\\\$&")}"', '
1072
1072
  var SITE_NOTICES = `Third-party software in this site's _dogsbay/ files (dogsbay.js, site.css) and pages
1073
1073
 
1074
1074
  ========================================================================
1075
- @dogsbay/elements@0.2.0-beta.133 (MIT)
1075
+ @dogsbay/elements@0.2.0-beta.135 (MIT)
1076
1076
  https://github.com/dogsbay/dogsbay.git
1077
1077
 
1078
1078
  Licensed under MIT; the package ships no licence file.
1079
1079
 
1080
1080
  ========================================================================
1081
- @dogsbay/primitives@0.2.0-beta.133 (MIT)
1081
+ @dogsbay/primitives@0.2.0-beta.135 (MIT)
1082
1082
  https://github.com/dogsbay/dogsbay.git
1083
1083
 
1084
1084
  Licensed under MIT; the package ships no licence file.
1085
1085
 
1086
1086
  ========================================================================
1087
- @dogsbay/render-html@0.2.0-beta.133 (MIT)
1087
+ @dogsbay/render-html@0.2.0-beta.135 (MIT)
1088
1088
  https://github.com/dogsbay/dogsbay.git
1089
1089
 
1090
1090
  Licensed under MIT; the package ships no licence file.
1091
1091
 
1092
1092
  ========================================================================
1093
- @dogsbay/search@0.2.0-beta.133 (MIT)
1093
+ @dogsbay/search@0.2.0-beta.135 (MIT)
1094
1094
  https://github.com/dogsbay/dogsbay.git
1095
1095
 
1096
1096
  Licensed under MIT; the package ships no licence file.
1097
1097
 
1098
1098
  ========================================================================
1099
- @dogsbay/ui@0.2.0-beta.133 (MIT)
1099
+ @dogsbay/ui@0.2.0-beta.135 (MIT)
1100
1100
  https://github.com/dogsbay/dogsbay.git
1101
1101
 
1102
1102
  Licensed under MIT; the package ships no licence file.
@@ -3406,10 +3406,14 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3406
3406
  const sanitizing = (cfg.html ?? input.defaultHtml ?? "keep") === "sanitize";
3407
3407
  const activeFiles = [];
3408
3408
  const untrustedFiles = [];
3409
+ const leftOut = /* @__PURE__ */ new Map();
3409
3410
  for (const [p, c] of files) {
3410
3411
  if (buildOnly(p)) continue;
3411
3412
  if (/\.(md|markdown)$/i.test(p)) {
3412
- if (excluded(p)) continue;
3413
+ if (excluded(p)) {
3414
+ leftOut.set(slugFromPath(p), cfg.excludeFromRoutes.find((d) => p === d || p.startsWith(d.replace(/\/+$/, "") + "/")) ?? "_ or . files");
3415
+ continue;
3416
+ }
3413
3417
  const slug = slugFromPath(p);
3414
3418
  const memo2 = state.scan?.entry(abs(p), c);
3415
3419
  let text;
@@ -3423,7 +3427,10 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3423
3427
  }
3424
3428
  if (memo2) memo2.fm = detachValue(fm);
3425
3429
  }
3426
- if (fm.status === "draft" && !input.includeDrafts) continue;
3430
+ if (fm.status === "draft" && !input.includeDrafts) {
3431
+ leftOut.set(slug, "draft");
3432
+ continue;
3433
+ }
3427
3434
  if (templatesOf(p).isPartial(fm, p)) continue;
3428
3435
  const inUnit = (s) => unit.prefix && (s === unit.prefix || s.startsWith(unit.prefix + "/")) ? s : [unit.prefix, s].filter(Boolean).join("/");
3429
3436
  const pageNs = named.length ? namespaceOf(p) : "";
@@ -3610,12 +3617,27 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3610
3617
  const childLinkNav = (nodes) => nodes.map((n) => ({ label: n.label, href: n.slug != null ? `/${n.slug}` : n.href, children: childLinkNav(n.children) }));
3611
3618
  let childLinkItems;
3612
3619
  let childLinkDirs;
3613
- for (const s of order) if (!infos.has(s) && !stubTargets.has(s)) warn("nav", `nav entry "${s}" has no page`, navFileAt());
3620
+ const isLeftOut = (s) => !infos.has(s) && !stubTargets.has(s) && leftOut.has(s);
3621
+ for (const s of order) if (!infos.has(s) && !stubTargets.has(s) && !leftOut.has(s)) warn("nav", `nav entry "${s}" has no page`, navFileAt());
3614
3622
  if (cfg.routablesFrom === "nav") {
3615
3623
  const keep = new Set(order);
3616
3624
  for (const s of [...infos.keys()]) if (s !== "" && !keep.has(s)) infos.delete(s);
3617
3625
  }
3626
+ const excludedEntries = /* @__PURE__ */ new Map();
3618
3627
  const dropMissing = (nodes) => {
3628
+ const kept = nodes.filter((n) => {
3629
+ const had = n.children.length;
3630
+ dropMissing(n.children);
3631
+ if (n.slug != null && isLeftOut(n.slug)) {
3632
+ const why = leftOut.get(n.slug);
3633
+ if (why !== "draft") excludedEntries.set(why, (excludedEntries.get(why) ?? 0) + 1);
3634
+ delete n.slug;
3635
+ delete n.fragment;
3636
+ return n.children.length > 0;
3637
+ }
3638
+ return !(had > 0 && n.children.length === 0 && n.slug == null && n.href == null);
3639
+ });
3640
+ nodes.splice(0, nodes.length, ...kept);
3619
3641
  for (const n of nodes) {
3620
3642
  if (n.slug != null && !infos.has(n.slug)) {
3621
3643
  const stub = stubTargets.get(n.slug);
@@ -3636,10 +3658,14 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3636
3658
  } else warn("nav", `nav entry "${from}" redirects to /${stub.to}, which is not a page of this build; it keeps its label without a link`);
3637
3659
  }
3638
3660
  }
3639
- dropMissing(n.children);
3640
3661
  }
3641
3662
  };
3642
3663
  dropMissing(nav);
3664
+ if (excludedEntries.size) {
3665
+ const n = [...excludedEntries.values()].reduce((a, b) => a + b, 0);
3666
+ const why = [...excludedEntries.keys()].slice(0, 5).join(", ");
3667
+ warn("nav", n === 1 ? `1 nav entry left out: its page is excluded from routes (${why})` : `${n} nav entries left out: their pages are excluded from routes (${why})`, navFileAt());
3668
+ }
3643
3669
  const blogIndex = cfg.blog?.path;
3644
3670
  const replaced = blogIndex === "" ? "" : void 0;
3645
3671
  if (blogIndex && infos.has(blogIndex)) warn("duplicate-page", `the page ${infos.get(blogIndex).source} and the blog index both serve /${blogIndex} on hosts that drop .html; rename one`);
@@ -3663,7 +3689,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3663
3689
  const t_ = strings(unit.locale ?? cfg.defaultLocale, void 0);
3664
3690
  const lang = unit.locale ?? cfg.defaultLocale ?? "en";
3665
3691
  const dir = /^(ar|he|fa|ur)(-|$)/.test(unit.locale ?? "") ? "rtl" : "ltr";
3666
- const search = cfg.search && cfg.searchEngine !== "pagefind" ? new SearchIndexBuilder({ lang: unit.locale ?? cfg.defaultLocale ?? "en" }) : void 0;
3692
+ let search = cfg.search && cfg.searchEngine !== "pagefind" ? new SearchIndexBuilder({ lang: unit.locale ?? cfg.defaultLocale ?? "en" }) : void 0;
3667
3693
  const siteDepthPrefix = unit.prefix ? "../".repeat(unit.prefix.split("/").length) : "";
3668
3694
  phase.scan = (phase.scan ?? 0) + now() - t;
3669
3695
  input.onUnitAssets?.(unit.prefix, assetPaths);
@@ -4024,7 +4050,11 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
4024
4050
  const unitHref = (slug) => pageRefs.get(slug)?.out;
4025
4051
  await emit(prefix + "_dogsbay/nav.js", `window.__DOGSBAY_NAV__=${JSON.stringify(compactNav(nav, unitHref)).replace(/<\//g, "<\\/")};
4026
4052
  `);
4027
- if (search) for (const [f, c] of search.emitFiles()) await emit(`${prefix}_dogsbay/search/${f}`, c);
4053
+ if (search) {
4054
+ const written = search;
4055
+ search = void 0;
4056
+ for (const [f, c] of written.emitFiles()) await emit(`${prefix}_dogsbay/search/${f}`, c);
4057
+ }
4028
4058
  if (!infos.has("") && blogIndex !== "") {
4029
4059
  const first = readingOrder[0] ?? [...infos.keys()][0];
4030
4060
  if (first != null) await emit(prefix + "index.html", redirectPage(pageRefs.get(first).out, cfg.name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dogsbay/ssg",
3
- "version": "0.2.0-beta.133",
3
+ "version": "0.2.0-beta.135",
4
4
  "type": "module",
5
5
  "description": "Documentation static site generator for Dogsbay-MD that builds inside Cloudflare Workers and publishes sites that work offline",
6
6
  "license": "Apache-2.0",
@@ -47,38 +47,38 @@
47
47
  "tailwindcss": "^4.3.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "@dogsbay/elements": "0.2.0-beta.133",
51
- "@dogsbay/format-dogsbay-md": "0.2.0-beta.133",
52
- "@dogsbay/format-openapi": "0.2.0-beta.133",
53
- "@dogsbay/format-topicmap": "0.2.0-beta.133",
54
- "@dogsbay/highlight": "0.2.0-beta.133",
55
- "@dogsbay/minja": "0.2.0-beta.133",
56
- "@dogsbay/primitives": "0.2.0-beta.133",
57
- "@dogsbay/render-html": "0.2.0-beta.133",
58
- "@dogsbay/search": "0.2.0-beta.133",
59
- "@dogsbay/serialize-core": "0.2.0-beta.133",
60
- "@dogsbay/site-check": "0.2.0-beta.133",
61
- "@dogsbay/site-files": "0.2.0-beta.133",
62
- "@dogsbay/types": "0.2.0-beta.133"
50
+ "@dogsbay/elements": "0.2.0-beta.135",
51
+ "@dogsbay/format-dogsbay-md": "0.2.0-beta.135",
52
+ "@dogsbay/format-openapi": "0.2.0-beta.135",
53
+ "@dogsbay/format-topicmap": "0.2.0-beta.135",
54
+ "@dogsbay/highlight": "0.2.0-beta.135",
55
+ "@dogsbay/minja": "0.2.0-beta.135",
56
+ "@dogsbay/primitives": "0.2.0-beta.135",
57
+ "@dogsbay/render-html": "0.2.0-beta.135",
58
+ "@dogsbay/search": "0.2.0-beta.135",
59
+ "@dogsbay/serialize-core": "0.2.0-beta.135",
60
+ "@dogsbay/site-check": "0.2.0-beta.135",
61
+ "@dogsbay/site-files": "0.2.0-beta.135",
62
+ "@dogsbay/types": "0.2.0-beta.135"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@axe-core/playwright": "^4.12.1",
66
66
  "@cloudflare/workers-types": "^5.20260921.1",
67
- "@dogsbay/elements": "0.2.0-beta.133",
68
- "@dogsbay/format-dogsbay-md": "0.2.0-beta.133",
69
- "@dogsbay/format-openapi": "0.2.0-beta.133",
70
- "@dogsbay/format-topicmap": "0.2.0-beta.133",
71
- "@dogsbay/highlight": "0.2.0-beta.133",
72
- "@dogsbay/icons": "0.2.0-beta.133",
73
- "@dogsbay/minja": "0.2.0-beta.133",
74
- "@dogsbay/primitives": "0.2.0-beta.133",
75
- "@dogsbay/render-html": "0.2.0-beta.133",
76
- "@dogsbay/search": "0.2.0-beta.133",
77
- "@dogsbay/serialize-core": "0.2.0-beta.133",
78
- "@dogsbay/site-check": "0.2.0-beta.133",
79
- "@dogsbay/site-files": "0.2.0-beta.133",
80
- "@dogsbay/types": "0.2.0-beta.133",
81
- "@dogsbay/ui": "0.2.0-beta.133",
67
+ "@dogsbay/elements": "0.2.0-beta.135",
68
+ "@dogsbay/format-dogsbay-md": "0.2.0-beta.135",
69
+ "@dogsbay/format-openapi": "0.2.0-beta.135",
70
+ "@dogsbay/format-topicmap": "0.2.0-beta.135",
71
+ "@dogsbay/highlight": "0.2.0-beta.135",
72
+ "@dogsbay/icons": "0.2.0-beta.135",
73
+ "@dogsbay/minja": "0.2.0-beta.135",
74
+ "@dogsbay/primitives": "0.2.0-beta.135",
75
+ "@dogsbay/render-html": "0.2.0-beta.135",
76
+ "@dogsbay/search": "0.2.0-beta.135",
77
+ "@dogsbay/serialize-core": "0.2.0-beta.135",
78
+ "@dogsbay/site-check": "0.2.0-beta.135",
79
+ "@dogsbay/site-files": "0.2.0-beta.135",
80
+ "@dogsbay/types": "0.2.0-beta.135",
81
+ "@dogsbay/ui": "0.2.0-beta.135",
82
82
  "@mermanjs/web": "0.7.0",
83
83
  "@playwright/test": "1.61.1",
84
84
  "@types/node": "^22.10.0",