@heroiclands/package-build 23.13.0 → 24.0.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.
Files changed (236) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +2 -1
  3. package/assets/preview/gitea.ini +12 -7
  4. package/assets/styles/content-base.css +150 -1
  5. package/bin/content-commands.mjs +356 -210
  6. package/bin/package-build.mjs +3 -2
  7. package/ci/check-banners.mjs +7 -7
  8. package/config.mjs +21 -6
  9. package/content-config.mjs +199 -80
  10. package/docs/api.md +93 -72
  11. package/docs/authoring/links-and-markup.md +316 -78
  12. package/docs/commands.md +248 -80
  13. package/docs/configuration.md +210 -102
  14. package/docs/content-format.md +2 -2
  15. package/docs/diagnostics.md +2 -2
  16. package/docs/getting-started.md +1 -1
  17. package/docs/guides/icons.md +1 -1
  18. package/docs/guides/module-project.md +5 -8
  19. package/docs/guides/release-and-deploy.md +2 -2
  20. package/docs/guides/site.md +155 -23
  21. package/docs/guides/system-project.md +1 -1
  22. package/docs/guides/writing-in-invented-scripts.md +1247 -0
  23. package/docs/index.md +1 -0
  24. package/docs/project-setup.md +28 -30
  25. package/docs/reference/format-details.md +589 -308
  26. package/docs/reference/note-types.md +40 -10
  27. package/docs/reference/theme-pages.md +127 -108
  28. package/docs/source-preview.md +15 -1
  29. package/engine/asset-shipping.mjs +22 -10
  30. package/engine/base-compiler.mjs +62 -104
  31. package/engine/changelog-lint.mjs +1 -1
  32. package/engine/content-address.mjs +1 -1
  33. package/engine/content-alerts.mjs +8 -4
  34. package/engine/content-blocks.mjs +26 -11
  35. package/engine/content-embeds.mjs +1 -1
  36. package/engine/content-expand.mjs +376 -0
  37. package/engine/content-figures.mjs +13 -6
  38. package/engine/content-format.yaml +8 -0
  39. package/engine/content-glyphs.mjs +213 -0
  40. package/engine/content-images.mjs +6 -7
  41. package/engine/content-links.mjs +3 -3
  42. package/engine/content-lint.mjs +1 -1
  43. package/engine/content-render.mjs +453 -0
  44. package/engine/content-scripts.mjs +326 -27
  45. package/engine/content-spans.mjs +4 -1
  46. package/engine/content-styles.mjs +91 -0
  47. package/engine/content-symbols.mjs +186 -0
  48. package/engine/content-verse.mjs +6 -18
  49. package/engine/core-report.mjs +169 -0
  50. package/engine/core-vocabulary.mjs +208 -0
  51. package/engine/dictionary-html.mjs +119 -0
  52. package/engine/field-reference.mjs +1 -1
  53. package/engine/frontmatter-lint.mjs +1 -1
  54. package/engine/heading-attributes.mjs +89 -0
  55. package/engine/helpers.mjs +61 -101
  56. package/engine/homepage.mjs +17 -29
  57. package/engine/html-minify.mjs +70 -0
  58. package/engine/index.mjs +8 -5
  59. package/engine/language-rows.mjs +8 -2
  60. package/engine/language-terms.mjs +115 -14
  61. package/engine/language-words.mjs +12 -0
  62. package/engine/logographic.mjs +255 -0
  63. package/engine/map-lexicon.mjs +221 -25
  64. package/engine/map-places.mjs +5 -4
  65. package/engine/markdown-expressions.mjs +0 -2
  66. package/engine/markdownlint-run.mjs +9 -3
  67. package/engine/markup-validation.mjs +21 -0
  68. package/engine/metre-declaration.mjs +134 -0
  69. package/engine/note-matter.mjs +2 -2
  70. package/engine/note-vocabulary.mjs +187 -3
  71. package/engine/pdf-build.mjs +68 -133
  72. package/engine/pdf-render.mjs +102 -44
  73. package/engine/post-fields.mjs +157 -0
  74. package/engine/preview-index.mjs +130 -0
  75. package/engine/preview-source.mjs +450 -0
  76. package/engine/project-init.mjs +5 -12
  77. package/engine/prose-config.mjs +3 -3
  78. package/engine/run-words.mjs +3 -2
  79. package/engine/script-emphasis-terms.mjs +38 -0
  80. package/engine/script-emphasis.mjs +295 -0
  81. package/engine/script-font-delivery.mjs +4 -4
  82. package/engine/site-build.mjs +265 -313
  83. package/engine/site-config.mjs +26 -238
  84. package/engine/site-files.mjs +175 -0
  85. package/engine/site-index.mjs +9 -4
  86. package/engine/site-preview.mjs +50 -523
  87. package/engine/site-reach.mjs +213 -0
  88. package/engine/site-render.mjs +668 -0
  89. package/engine/site-root.mjs +90 -39
  90. package/engine/site-search.mjs +161 -0
  91. package/engine/site-serve.mjs +274 -0
  92. package/engine/site-theme-banner.mjs +154 -0
  93. package/engine/site-theme-urls.mjs +125 -0
  94. package/engine/site-theme.mjs +939 -0
  95. package/engine/sql-tables.mjs +9 -6
  96. package/engine/text-maps.mjs +57 -10
  97. package/engine/typographer.mjs +248 -0
  98. package/engine/verse-metre.mjs +357 -0
  99. package/engine/wikilink-syntax.mjs +29 -47
  100. package/engine/wikilinks.mjs +758 -279
  101. package/engine/word-forms.mjs +39 -24
  102. package/engine/word-rows.mjs +12 -2
  103. package/engine/word-terms.mjs +29 -4
  104. package/manifest.mjs +3 -4
  105. package/package.json +10 -7
  106. package/{hugo-theme → site-theme}/data/banners.yaml +6 -10
  107. package/site-theme/layouts/base.hbs +31 -0
  108. package/site-theme/layouts/blog-list.hbs +30 -0
  109. package/site-theme/layouts/blog-post.hbs +40 -0
  110. package/site-theme/layouts/home.hbs +35 -0
  111. package/site-theme/layouts/list.hbs +20 -0
  112. package/site-theme/layouts/not-found.hbs +31 -0
  113. package/site-theme/layouts/page.hbs +7 -0
  114. package/site-theme/partials/copy-buttons.hbs +37 -0
  115. package/site-theme/partials/draft-notice.hbs +5 -0
  116. package/site-theme/partials/exturl.hbs +2 -0
  117. package/{hugo-theme/layouts/partials/footer.html → site-theme/partials/footer.hbs} +10 -7
  118. package/site-theme/partials/header.hbs +44 -0
  119. package/site-theme/partials/hero-banner.hbs +11 -0
  120. package/site-theme/partials/infobox-entry.hbs +2 -0
  121. package/site-theme/partials/infobox-section.hbs +31 -0
  122. package/site-theme/partials/infobox-value.hbs +2 -0
  123. package/site-theme/partials/infobox.hbs +18 -0
  124. package/site-theme/partials/list-members.hbs +9 -0
  125. package/site-theme/partials/nav-links.hbs +5 -0
  126. package/site-theme/partials/page-body.hbs +48 -0
  127. package/site-theme/partials/page-list.hbs +14 -0
  128. package/site-theme/partials/related.hbs +24 -0
  129. package/site-theme/partials/search-meta.hbs +6 -0
  130. package/site-theme/partials/search-names.hbs +2 -0
  131. package/site-theme/partials/search.hbs +52 -0
  132. package/site-theme/partials/tags.hbs +4 -0
  133. package/site-theme/partials/toc.hbs +7 -0
  134. package/{hugo-theme → site-theme}/static/css/style.css +14 -0
  135. package/stage.mjs +1 -2
  136. package/types/config.d.mts +8 -4
  137. package/types/content-config.d.mts +15 -15
  138. package/types/engine/asset-shipping.d.mts +5 -2
  139. package/types/engine/base-compiler.d.mts +20 -2
  140. package/types/engine/content-address.d.mts +1 -1
  141. package/types/engine/content-alerts.d.mts +8 -2
  142. package/types/engine/content-blocks.d.mts +11 -4
  143. package/types/engine/content-expand.d.mts +288 -0
  144. package/types/engine/content-figures.d.mts +11 -3
  145. package/types/engine/content-glyphs.d.mts +85 -0
  146. package/types/engine/content-images.d.mts +6 -7
  147. package/types/engine/content-links.d.mts +1 -1
  148. package/types/engine/content-render.d.mts +199 -0
  149. package/types/engine/content-scripts.d.mts +62 -0
  150. package/types/engine/content-spans.d.mts +1 -1
  151. package/types/engine/content-styles.d.mts +33 -0
  152. package/types/engine/content-symbols.d.mts +35 -0
  153. package/types/engine/core-report.d.mts +45 -0
  154. package/types/engine/core-vocabulary.d.mts +53 -0
  155. package/types/engine/dictionary-html.d.mts +8 -0
  156. package/types/engine/field-reference.d.mts +1 -1
  157. package/types/engine/heading-attributes.d.mts +20 -0
  158. package/types/engine/helpers.d.mts +3 -10
  159. package/types/engine/homepage.d.mts +11 -24
  160. package/types/engine/html-minify.d.mts +9 -0
  161. package/types/engine/index.d.mts +2 -1
  162. package/types/engine/language-terms.d.mts +24 -2
  163. package/types/engine/logographic.d.mts +45 -0
  164. package/types/engine/map-lexicon.d.mts +48 -8
  165. package/types/engine/map-places.d.mts +8 -0
  166. package/types/engine/markdown-expressions.d.mts +0 -2
  167. package/types/engine/metre-declaration.d.mts +39 -0
  168. package/types/engine/pdf-render.d.mts +6 -2
  169. package/types/engine/post-fields.d.mts +44 -0
  170. package/types/engine/preview-index.d.mts +72 -0
  171. package/types/engine/preview-source.d.mts +51 -0
  172. package/types/engine/script-emphasis-terms.d.mts +21 -0
  173. package/types/engine/script-emphasis.d.mts +84 -0
  174. package/types/engine/script-font-delivery.d.mts +4 -4
  175. package/types/engine/site-build.d.mts +71 -113
  176. package/types/engine/site-config.d.mts +14 -134
  177. package/types/engine/site-files.d.mts +73 -0
  178. package/types/engine/site-index.d.mts +11 -3
  179. package/types/engine/site-preview.d.mts +15 -19
  180. package/types/engine/site-reach.d.mts +76 -0
  181. package/types/engine/site-render.d.mts +173 -0
  182. package/types/engine/site-root.d.mts +14 -4
  183. package/types/engine/site-search.d.mts +54 -0
  184. package/types/engine/site-serve.d.mts +44 -0
  185. package/types/engine/site-theme-banner.d.mts +51 -0
  186. package/types/engine/site-theme-urls.d.mts +60 -0
  187. package/types/engine/site-theme.d.mts +127 -0
  188. package/types/engine/text-maps.d.mts +17 -3
  189. package/types/engine/typographer.d.mts +11 -0
  190. package/types/engine/verse-metre.d.mts +131 -0
  191. package/types/engine/wikilink-syntax.d.mts +30 -48
  192. package/types/engine/wikilinks.d.mts +330 -14
  193. package/types/engine/word-forms.d.mts +3 -2
  194. package/types/manifest.d.mts +3 -4
  195. package/types/stage.d.mts +1 -2
  196. package/types/vendor/markdownlint.d.mts +8 -0
  197. package/vendor/markdownlint.mjs +20388 -0
  198. package/engine/web-wikilinks.mjs +0 -594
  199. package/hugo-theme/layouts/404.html +0 -85
  200. package/hugo-theme/layouts/_default/baseof.html +0 -67
  201. package/hugo-theme/layouts/_default/list.html +0 -139
  202. package/hugo-theme/layouts/_default/single.html +0 -4
  203. package/hugo-theme/layouts/blog/list.html +0 -54
  204. package/hugo-theme/layouts/blog-post/single.html +0 -36
  205. package/hugo-theme/layouts/index.html +0 -75
  206. package/hugo-theme/layouts/partials/banner-url.html +0 -141
  207. package/hugo-theme/layouts/partials/cdn-url.html +0 -36
  208. package/hugo-theme/layouts/partials/dictionary-lists.html +0 -58
  209. package/hugo-theme/layouts/partials/draft-notice.html +0 -41
  210. package/hugo-theme/layouts/partials/draft-state.html +0 -26
  211. package/hugo-theme/layouts/partials/header.html +0 -35
  212. package/hugo-theme/layouts/partials/hero-banner.html +0 -85
  213. package/hugo-theme/layouts/partials/infobox/entry.html +0 -18
  214. package/hugo-theme/layouts/partials/infobox/items.html +0 -26
  215. package/hugo-theme/layouts/partials/infobox/section.html +0 -56
  216. package/hugo-theme/layouts/partials/infobox/value.html +0 -43
  217. package/hugo-theme/layouts/partials/infobox.html +0 -57
  218. package/hugo-theme/layouts/partials/page-body.html +0 -152
  219. package/hugo-theme/layouts/partials/related.html +0 -138
  220. package/hugo-theme/layouts/partials/search.html +0 -84
  221. package/hugo-theme/layouts/partials/site-url.html +0 -32
  222. package/hugo-theme/layouts/partials/tags.html +0 -30
  223. package/hugo-theme/layouts/partials/toc.html +0 -28
  224. package/hugo-theme/layouts/partials/warn-missing-banner.html +0 -3
  225. package/hugo-theme/layouts/shortcodes/cartouche.html +0 -64
  226. package/hugo-theme/layouts/shortcodes/exturl.html +0 -12
  227. package/hugo-theme/layouts/shortcodes/glyph.html +0 -43
  228. package/hugo-theme/layouts/shortcodes/pagelist.html +0 -63
  229. package/hugo-theme/theme.toml +0 -11
  230. package/types/engine/web-wikilinks.d.mts +0 -107
  231. /package/{hugo-theme → site-theme}/data/banner-kinds.yaml +0 -0
  232. /package/{hugo-theme → site-theme}/static/css/sohl-icons.css +0 -0
  233. /package/{hugo-theme → site-theme}/static/fonts/game-icons-kb.woff2 +0 -0
  234. /package/{hugo-theme → site-theme}/static/img/banners/takheperu-hieroglyphs.svg +0 -0
  235. /package/{hugo-theme → site-theme}/static/img/cartouches/takheperu.svg +0 -0
  236. /package/{hugo-theme → site-theme}/static/js/inline-spoilers.js +0 -0
@@ -0,0 +1,11 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <section class="hero hero-with-image"{{#if bannerUrl}} style="background-image: url('{{cssUrl bannerUrl}}');"{{/if}}>
3
+ <div class="hero-inner" data-pagefind-ignore>
4
+ {{#if title}}
5
+ <h1>{{title}}</h1>
6
+ {{/if}}
7
+ {{#if tagline}}
8
+ <p class="hero-tagline">{{tagline}}</p>
9
+ {{/if}}
10
+ </div>
11
+ </section>
@@ -0,0 +1,2 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#if entry.lead}}{{entry.lead}}{{/if}}{{#if entry.url}}<a class="{{class}}" href="{{entry.url}}">{{entry.text}}</a>{{else}}<span class="{{class}}">{{entry.text}}</span>{{/if}}
@@ -0,0 +1,31 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#if rows}}
3
+ <dl class="info-profile-grid">
4
+ {{#each rows}}
5
+ <dt>{{label}}</dt>
6
+ <dd>{{> infobox-value}}</dd>
7
+ {{/each}}
8
+ </dl>
9
+ {{else if grid}}
10
+ <div class="info-attrs-grid">
11
+ {{#each cells}}
12
+ <div class="info-attr">
13
+ <span class="attr-label">{{label}}</span>
14
+ <span class="attr-value">{{value}}</span>
15
+ </div>
16
+ {{/each}}
17
+ </div>
18
+ {{else if runin}}
19
+ {{#each groups}}
20
+ <p class="info-skill-line">
21
+ {{#if label}}<span class="skill-cat">{{label}}:</span>{{/if}}
22
+ <span class="skill-entries">{{#each entries}}{{#unless @first}}, {{/unless}}{{> infobox-entry entry=this class="skill-entry"}}{{/each}}</span>
23
+ </p>
24
+ {{/each}}
25
+ {{else if list}}
26
+ <ul class="info-mystical-list">
27
+ {{#each entries}}
28
+ <li class="info-mystical-item">{{> infobox-entry entry=this class="mystical-name"}}</li>
29
+ {{/each}}
30
+ </ul>
31
+ {{/if}}
@@ -0,0 +1,2 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#if isLink}}{{> infobox-entry entry=entry class="info-link"}}{{else if isLinks}}{{#each entries}}{{#unless @first}}, {{/unless}}{{> infobox-entry entry=this class="info-link"}}{{/each}}{{else}}{{text}}{{/if}}
@@ -0,0 +1,18 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#each boxes}}
3
+ <details class="info-sidebar info-box{{#if id}} info-box-{{id}}{{/if}}" open data-pagefind-ignore>
4
+ <summary class="info-sidebar-title"><h2>{{title}}</h2></summary>
5
+ {{#if statement}}
6
+ <p class="info-statement">{{statement}}</p>
7
+ {{else}}
8
+ {{#each sections}}
9
+ <section class="info-section{{#if id}} info-section-{{id}}{{/if}}">
10
+ {{#if label}}
11
+ <h3 class="info-section-title">{{label}}</h3>
12
+ {{/if}}
13
+ {{> infobox-section}}
14
+ </section>
15
+ {{/each}}
16
+ {{/if}}
17
+ </details>
18
+ {{/each}}
@@ -0,0 +1,9 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#if listing}}
3
+ {{#if heading}}
4
+ <h2 class="page-list-heading">{{heading}}</h2>
5
+ {{/if}}
6
+ {{> page-list listing}}
7
+ {{else if empty}}
8
+ <p class="page-list-empty">Nothing here yet.</p>
9
+ {{/if}}
@@ -0,0 +1,5 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <nav class="single-nav" data-pagefind-ignore>
3
+ {{#if prev}}<a href="{{prev.url}}" class="nav-prev">&larr; {{prev.title}}</a>{{/if}}
4
+ {{#if next}}<a href="{{next.url}}" class="nav-next">{{next.title}} &rarr;</a>{{/if}}
5
+ </nav>
@@ -0,0 +1,48 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <article class="{{articleClass}}"{{#unless hasBody}} data-pagefind-body{{/unless}}>
3
+ {{#if isDraft}}
4
+ {{> draft-notice}}
5
+ {{/if}}
6
+ {{> search-meta search}}
7
+ {{#unless hasBody}}{{> search-names search}}{{/unless}}
8
+ {{#if hasSidebar}}
9
+ <aside class="info-rail">
10
+ {{> infobox}}
11
+ {{#if tocBeside}}
12
+ {{> toc}}
13
+ {{/if}}
14
+ </aside>
15
+ {{/if}}
16
+ {{#if hasMain}}
17
+ <div class="single-content">
18
+ {{#if meta}}
19
+ <div class="single-meta">
20
+ {{#if meta.date}}
21
+ <time class="single-date" datetime="{{meta.date.iso}}">{{meta.date.text}}</time>
22
+ {{/if}}
23
+ {{#if meta.subtype}}<span class="single-subtype">{{meta.subtype}}</span>{{/if}}
24
+ {{#if meta.tags}}
25
+ {{> tags meta.tags}}
26
+ {{/if}}
27
+ </div>
28
+ {{/if}}
29
+
30
+ {{#if hasBody}}
31
+ <div class="single-body" data-pagefind-body>
32
+ {{> search-names search}}
33
+ {{{content}}}
34
+ </div>
35
+ {{/if}}
36
+
37
+ {{#if related}}
38
+ {{> related related}}
39
+ {{/if}}
40
+ {{#if nav}}
41
+ {{> nav-links nav}}
42
+ {{/if}}
43
+ </div>
44
+ {{/if}}
45
+ {{#if tocBelow}}
46
+ {{> toc}}
47
+ {{/if}}
48
+ </article>
@@ -0,0 +1,14 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <ul class="page-list">
3
+ {{#each items}}
4
+ <li class="page-list-item">
5
+ <a class="page-list-title" href="{{url}}">{{title}}</a>
6
+ {{#if count}}
7
+ <span class="page-list-count">{{count}}</span>
8
+ {{/if}}
9
+ {{#if text}}
10
+ <span class="page-list-desc">{{text}}</span>
11
+ {{/if}}
12
+ </li>
13
+ {{/each}}
14
+ </ul>
@@ -0,0 +1,24 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <section class="related" aria-labelledby="related-heading" data-pagefind-ignore>
3
+ <h2 id="related-heading" class="related-heading">Related</h2>
4
+ {{#if seeAlso}}
5
+ <div class="related-group">
6
+ <h3 class="related-group-label">See also</h3>
7
+ <ul class="related-group-grid">
8
+ {{#each seeAlso}}
9
+ <li><a href="{{url}}">{{title}}</a>{{#if gloss}} — {{gloss}}{{/if}}</li>
10
+ {{/each}}
11
+ </ul>
12
+ </div>
13
+ {{/if}}
14
+ {{#each groups}}
15
+ <div class="related-group">
16
+ <h3 class="related-group-label">{{label}}</h3>
17
+ <ul class="related-group-grid">
18
+ {{#each refs}}
19
+ <li><a href="{{url}}">{{title}}</a></li>
20
+ {{/each}}
21
+ </ul>
22
+ </div>
23
+ {{/each}}
24
+ </section>
@@ -0,0 +1,6 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#if title}}<span data-pagefind-meta="title" hidden>{{title}}</span>{{/if}}
3
+ {{#each filters}}{{#each values}}<span data-pagefind-filter="{{../name}}" hidden>{{this}}</span>{{/each}}{{/each}}
4
+ {{#if aliases}}<span data-pagefind-meta="aliases" hidden>{{aliases}}</span>{{/if}}
5
+ {{#if image}}<span data-pagefind-meta="image" hidden>{{image}}</span>{{/if}}
6
+ {{#if date}}<span data-pagefind-sort="date" hidden>{{date}}</span>{{/if}}
@@ -0,0 +1,2 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ {{#if names}}<span data-pagefind-weight="{{weight}}" hidden>{{names}}</span>{{/if}}
@@ -0,0 +1,52 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <div class="site-search" data-pagefind-ignore>
3
+ <button
4
+ type="button"
5
+ class="search-toggle"
6
+ aria-label="Search"
7
+ aria-expanded="false"
8
+ aria-controls="site-search-panel"
9
+ ><i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i></button>
10
+ <div id="site-search-panel" class="search-panel" hidden>
11
+ <div class="search-panel-inner" id="search"></div>
12
+ </div>
13
+ </div>
14
+ <link rel="stylesheet" href="{{urls.pagefindCss}}">
15
+ <script src="{{urls.pagefindJs}}" defer></script>
16
+ <script>
17
+ (function () {
18
+ var toggle = document.querySelector(".search-toggle");
19
+ var panel = document.getElementById("site-search-panel");
20
+ if (!toggle || !panel) return;
21
+ var ui = null;
22
+
23
+ function open() {
24
+ panel.hidden = false;
25
+ toggle.setAttribute("aria-expanded", "true");
26
+ if (!ui && typeof PagefindUI !== "undefined") {
27
+ ui = new PagefindUI({{{json searchOptions}}});
28
+ }
29
+ var input = panel.querySelector("input");
30
+ if (input) input.focus();
31
+ }
32
+
33
+ function close() {
34
+ panel.hidden = true;
35
+ toggle.setAttribute("aria-expanded", "false");
36
+ }
37
+
38
+ toggle.addEventListener("click", function () {
39
+ if (panel.hidden) { open(); } else { close(); }
40
+ });
41
+
42
+ document.addEventListener("keydown", function (e) {
43
+ if (e.key === "Escape" && !panel.hidden) close();
44
+ });
45
+
46
+ document.addEventListener("click", function (e) {
47
+ if (panel.hidden) return;
48
+ if (panel.contains(e.target) || toggle.contains(e.target)) return;
49
+ close();
50
+ });
51
+ })();
52
+ </script>
@@ -0,0 +1,4 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <div class="single-tags">
3
+ {{#each items}}{{#if url}}<a href="{{url}}" class="tag">{{name}}</a>{{else}}<span class="tag">{{name}}</span>{{/if}}{{/each}}
4
+ </div>
@@ -0,0 +1,7 @@
1
+ {{!-- SPDX-License-Identifier: GPL-3.0-or-later --}}
2
+ <aside class="toc" aria-label="Table of contents" data-pagefind-ignore>
3
+ <div class="toc-inner">
4
+ <p class="toc-label">On this page</p>
5
+ {{{toc}}}
6
+ </div>
7
+ </aside>
@@ -53,6 +53,13 @@
53
53
  a footnote may be called from inside a blockquote or a named block. */
54
54
  --footnote-marker: var(--accent-hover);
55
55
 
56
+ /* A rubric script's emphasis, which is carried by colour alone. Checked
57
+ against every surface text sits on, and against --text so the emphasis
58
+ survives without its hue: 5.62:1 on --bg, 5.21:1 on --bg-card, 4.57:1 on
59
+ --surface, and 2.13:1 against --text. A consuming site that overrides it
60
+ re-checks both. */
61
+ --rubric: #e0705f;
62
+
56
63
  --font-display: 'Cinzel', 'Georgia', serif;
57
64
  --font-body: 'Lora', 'Georgia', serif;
58
65
  --font-mono: 'JetBrains Mono', monospace;
@@ -3110,3 +3117,10 @@ summary.info-sidebar-title::after {
3110
3117
  .font-serif { font-family:var(--font-body); }
3111
3118
  .font-sans { font-family:sans-serif; }
3112
3119
  .font-mono { font-family:var(--font-mono); }
3120
+
3121
+ /* Emphasis in a script follows the script's convention, never a weight or a
3122
+ slant the face does not have: the element keeps the face's Regular, and
3123
+ its class sets the convention. */
3124
+ .script :is(em, strong) { font-style:normal; font-weight:inherit; font-synthesis:none; }
3125
+ .emph-rubric { color:var(--rubric); }
3126
+ .emph-overline { text-decoration-line:overline; text-decoration-skip-ink:none; }
package/stage.mjs CHANGED
@@ -44,8 +44,7 @@ import path from "node:path";
44
44
  *
45
45
  * A repository adds its own through `packageBuild.clean.extra`, but these four
46
46
  * are common to all of them because they come from the shared toolchain rather
47
- * than from any one package's layout. Everything the site build writes — the
48
- * Hugo source tree, Hugo's cache and the rendered site — is under `build/`.
47
+ * than from any one package's layout. Everything the site build writes is under `build/`.
49
48
  */
50
49
  export const BUILD_ARTIFACT_DIRS = Object.freeze(["build", ".vite", ".vitepress", ".rollup.cache"]);
51
50
 
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Exported so a sibling module composing a configuration value this module
9
9
  * does not itself validate — {@link module:engine/site-config}'s
10
- * `hugoConfig`, checking `site.assets` — reports through the one helper
10
+ * `siteSettings`, checking `site.assets` — reports through the one helper
11
11
  * rather than a second copy.
12
12
  *
13
13
  * @param {string} where - Dotted path of the offending key.
@@ -32,8 +32,7 @@ export function resolveAssetTransform(declared: string, rootDir: string): string
32
32
  *
33
33
  * A package's Foundry manifest already derives its own `url` from
34
34
  * `contentPackage` (`packageHomepage` in `manifest.mjs`); `homepage` states
35
- * the same address a second time, in `package.json`, for the generated Hugo
36
- * configuration to read a `baseURL` from without knowing where each
35
+ * the same address a second time, in `package.json`, for the site build to read a base URL from without knowing where each
37
36
  * repository keeps its own site configuration.
38
37
  *
39
38
  * Required unconditionally: every package publishes a site, so there is no
@@ -45,12 +44,17 @@ export function resolveAssetTransform(declared: string, rootDir: string): string
45
44
  * `packageHomepage(contentPackage)`, independent of it. The right caller is
46
45
  * whatever reads `homepage` to write a site's `baseURL`.
47
46
  *
47
+ * A site that states `site.base` is served at that path instead, and its
48
+ * `homepage` is that path on its origin: `/` makes it the origin's root.
49
+ *
48
50
  * @param {string|null} homepage - The resolved `package.json` `homepage`, or
49
51
  * `null` when none is declared.
50
52
  * @param {string} contentPackage - The resolved `contentPackage`.
53
+ * @param {string} [base] - The resolved `site.base`; `""` or absent for a
54
+ * package site, served at `/<contentPackage>/`.
51
55
  * @returns {void}
52
56
  */
53
- export function checkHomepage(homepage: string | null, contentPackage: string): void;
57
+ export function checkHomepage(homepage: string | null, contentPackage: string, base?: string): void;
54
58
  /**
55
59
  * Resolve a package-build configuration from an already-loaded shared one.
56
60
  *
@@ -11,6 +11,20 @@
11
11
  export function compilesFoundryDocuments(config: {
12
12
  packageKind: string;
13
13
  }): boolean;
14
+ /**
15
+ * The path a package's site is served at: `site.base` where it states one,
16
+ * `/<contentPackage>/` otherwise.
17
+ *
18
+ * @param {{contentPackage: string, site: {base: string}}} config - The resolved
19
+ * configuration.
20
+ * @returns {string} The path, beginning and ending with `/`.
21
+ */
22
+ export function siteBase(config: {
23
+ contentPackage: string;
24
+ site: {
25
+ base: string;
26
+ };
27
+ }): string;
14
28
  /**
15
29
  * Whether this package publishes the pages its content tree compiles to.
16
30
  *
@@ -136,20 +150,6 @@ export const AUTHOR_ROLES: readonly string[];
136
150
  * @type {symbol}
137
151
  */
138
152
  export const DERIVED_SYSTEM_VERSION: symbol;
139
- /**
140
- * Hugo keys a repository may **not** declare under `site.hugo`, because the
141
- * site build generates them and would only overwrite what was written.
142
- *
143
- * The same rule `DERIVED_MANIFEST_KEYS` states for the manifest, for the same
144
- * reason: an authored `baseURL` would look authoritative, sit there unread,
145
- * and disagree with the site forever. Each key names where its value comes
146
- * from. A dotted key names a nested one, and covers everything beneath it —
147
- * `params.brand` refuses `params.brand.logo` too — so `site.hugo` reaches only
148
- * what the generator does not write.
149
- *
150
- * @type {Readonly<Record<string, string>>}
151
- */
152
- export const DERIVED_HUGO_KEYS: Readonly<Record<string, string>>;
153
153
  /**
154
154
  * One declared book, resolved.
155
155
  */
@@ -328,7 +328,7 @@ export type PathsInput = {
328
328
  metadataCache?: string | undefined;
329
329
  /**
330
330
  * Where the site navigation is fetched
331
- * to, for the generated Hugo menu.
331
+ * to, for the site's menu.
332
332
  */
333
333
  navigationCache?: string | undefined;
334
334
  };
@@ -112,8 +112,11 @@ export function assetsManifest(staged: readonly object[], stageDir: string): Ass
112
112
  *
113
113
  * The pictures are written beside whatever a `packageBuild.assets` row already
114
114
  * put under `icons/` and `images/`; nothing there is removed. A picture whose
115
- * deployed path is already a file in the stage is a finding, and no picture is
116
- * written. Clearing an earlier run's pictures is the stage reset's work.
115
+ * deployed path already holds a file with the bytes it would stage — after the
116
+ * transform, when there is one — is its own earlier output and is skipped, so
117
+ * staging twice into one directory is quiet. A file there with other bytes is a
118
+ * finding, and no picture is written. Clearing an earlier run's pictures is the
119
+ * stage reset's work.
117
120
  *
118
121
  * @param {object} opts - Options.
119
122
  * @param {string} opts.assetsBase - The package's asset directory, the roots'
@@ -1,3 +1,20 @@
1
+ /**
2
+ * The tallies one pass accumulates while walking the tree.
3
+ *
4
+ * `declined` and `skippedOther` are deliberately separate numbers. A declined
5
+ * note is one this build **refused** — it declares `package:` — and it is an
6
+ * error; a skipped one legitimately belongs to another pass, and
7
+ * there are thousands of those. Folding the first into the second is what let a
8
+ * whole tree be filtered out in silence.
9
+ *
10
+ * @typedef {object} PassStats
11
+ * @property {number} compiled - Notes that became a document.
12
+ * @property {number} skippedNoId - Notes with no `id`, where that is tolerated.
13
+ * @property {number} skippedOther - Notes this pass does not claim.
14
+ * @property {number} declined - Notes this pack **refused** — one declaring
15
+ * `package:`, or one routed to a system pack whose system it says nothing
16
+ * about. Counted as errors, never as skips.
17
+ */
1
18
  /**
2
19
  * The shared walk → filter → expand → convert → build → write → count loop.
3
20
  *
@@ -381,8 +398,9 @@ export class BasePackCompiler {
381
398
  /**
382
399
  * The body {@link BasePackCompiler#buildEntry} receives.
383
400
  *
384
- * Generated tables expand before wikilinks are converted, so a cell a
385
- * table emits is resolved along with the authored links.
401
+ * The body is expanded by {@link module:engine/content-expand.expandContent}
402
+ * for Foundry: generated tables expand before wikilinks are converted, so
403
+ * a cell a table emits is resolved along with the authored links.
386
404
  *
387
405
  * @param {object} fm - The note's frontmatter.
388
406
  * @param {string} body - The note body, as authored.
@@ -41,7 +41,7 @@ export function addressSlug(fm: object): string;
41
41
  * composing a URL prepends where the package is served (`/<package>/`); a
42
42
  * consumer composing a manifest entry measures against that same base. Nothing
43
43
  * else is prepended: `prefix` says where the content tree *mounts inside the
44
- * package* — the Hugo directory its pages are written under — and an address is
44
+ * package* — where its pages sit in the source tree — and an address is
45
45
  * `(type, shortcode)`, a package-wide identity that takes no mount, so `sohl`
46
46
  * publishes `/sohl/affliction-aconite/` from a file written under `kb/`. The
47
47
  * `type-` half is what keeps that flat namespace clear of the package's fixed
@@ -23,9 +23,15 @@ export function scanAlerts(source: string): {
23
23
  };
24
24
  /** Render alert wrappers while preserving ordinary Markdown and note footnotes.
25
25
  * @param {string} source - Authored Markdown.
26
- * @param {"web"|"foundry"} [target="web"] - Publishing surface.
26
+ * @param {"web"|"foundry"|"preview"} [target="web"] - Publishing surface: the
27
+ * preview draws the icon as an inline drawing, since a buffer has no icon font.
28
+ * @param {object} [options]
29
+ * @param {(markdown: string) => string} [options.renderInline] - How a title
30
+ * is rendered; omitted, a title is plain inline Markdown.
27
31
  */
28
- export function renderAlerts(source: string, target?: "web" | "foundry"): {
32
+ export function renderAlerts(source: string, target?: "web" | "foundry" | "preview", { renderInline }?: {
33
+ renderInline?: ((markdown: string) => string) | undefined;
34
+ }): {
29
35
  markdown: string;
30
36
  errors: {
31
37
  line: number;
@@ -28,7 +28,8 @@ export function scanBlocks(source: string): {
28
28
  * Render named blocks for one publishing surface.
29
29
  *
30
30
  * `foundry` emits a `<section>` whose heading is its first line; `web` emits a
31
- * `<details>` the reader opens. Neither carries an inline `style`.
31
+ * `<details>` the reader opens, and `preview` the same without the search
32
+ * marker. None carries an inline `style`.
32
33
  *
33
34
  * The body is left as Markdown between the wrapper's tags, each separated from
34
35
  * its tag by a blank line — see the module docs for why that is what lets the
@@ -38,10 +39,15 @@ export function scanBlocks(source: string): {
38
39
  * A finding does not stop the well-formed blocks around it from rendering.
39
40
  *
40
41
  * @param {string} source - Markdown containing named blocks.
41
- * @param {"foundry"|"web"} target - Publishing surface.
42
+ * @param {"foundry"|"web"|"preview"} target - Publishing surface.
43
+ * @param {object} [options]
44
+ * @param {(markdown: string) => string} [options.renderInline] - How a title
45
+ * is rendered; omitted, a title is plain inline Markdown.
42
46
  * @returns {{markdown: string, errors: Array<{line: number, column: number, message: string}>}}
43
47
  */
44
- export function renderBlocks(source: string, target: "foundry" | "web"): {
48
+ export function renderBlocks(source: string, target: "foundry" | "web" | "preview", { renderInline }?: {
49
+ renderInline?: ((markdown: string) => string) | undefined;
50
+ }): {
45
51
  markdown: string;
46
52
  errors: Array<{
47
53
  line: number;
@@ -58,7 +64,8 @@ export function renderBlocks(source: string, target: "foundry" | "web"): {
58
64
  *
59
65
  * **A spoiler, not access control.** The section is in the published page, so a
60
66
  * reader who opens the element or reads the source reads it. Foundry is the one
61
- * surface that withholds anything.
67
+ * surface that withholds anything. The disclosure is kept out of the site's
68
+ * search index, as a `secret` block is, so no result quotes it.
62
69
  *
63
70
  * @param {string} source - A page's Markdown, headings intact.
64
71
  * @returns {string} The same Markdown, each withheld section inside a