@heroiclands/package-build 23.11.0 → 23.12.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/CHANGELOG.md +27 -0
- package/README.md +1 -0
- package/assets/preview/check-sanitizer.go +68 -0
- package/assets/preview/gitea-theme.js +36 -0
- package/assets/preview/gitea.ini +127 -0
- package/assets/styles/content-base.css +119 -16
- package/bin/content-commands.mjs +2 -2
- package/bin/package-build-preview.mjs +75 -0
- package/content-config.mjs +11 -0
- package/docs/api.md +105 -46
- package/docs/authoring/links-and-markup.md +52 -14
- package/docs/commands.md +46 -2
- package/docs/configuration.md +21 -4
- package/docs/design.md +4 -3
- package/docs/guides/book.md +10 -6
- package/docs/reference/format-details.md +44 -40
- package/docs/reference/note-types.md +0 -1
- package/docs/reference/theme-pages.md +1 -1
- package/docs/source-preview.md +172 -0
- package/engine/base-compiler.mjs +7 -8
- package/engine/being-age.mjs +19 -105
- package/engine/calendar-notes.mjs +3 -25
- package/engine/compile-corpus.mjs +2 -1
- package/engine/content-format.yaml +0 -1
- package/engine/content-index.mjs +9 -9
- package/engine/content-spans.mjs +28 -6
- package/engine/current-date.mjs +37 -0
- package/engine/definition-list.mjs +58 -0
- package/engine/first-use.mjs +4 -2
- package/engine/frontmatter-lint.mjs +7 -2
- package/engine/helpers.mjs +2 -0
- package/engine/index.mjs +2 -0
- package/engine/infobox.mjs +1 -5
- package/engine/note-vocabulary.mjs +2 -2
- package/engine/npc-generate.mjs +7 -6
- package/engine/pdf-render.mjs +37 -4
- package/engine/preview-current-date.mjs +60 -0
- package/engine/site-build.mjs +5 -5
- package/engine/site-index.mjs +5 -2
- package/engine/site-preview.mjs +641 -325
- package/hugo-theme/layouts/_default/list.html +1 -1
- package/hugo-theme/layouts/blog/list.html +1 -1
- package/hugo-theme/layouts/blog-post/single.html +1 -1
- package/hugo-theme/layouts/partials/dictionary-lists.html +53 -0
- package/hugo-theme/layouts/partials/page-body.html +1 -1
- package/hugo-theme/static/css/style.css +22 -8
- package/package.json +8 -2
- package/types/content-config.d.mts +8 -0
- package/types/engine/base-compiler.d.mts +1 -1
- package/types/engine/being-age.d.mts +10 -44
- package/types/engine/calendar-notes.d.mts +2 -6
- package/types/engine/compile-corpus.d.mts +2 -1
- package/types/engine/content-index.d.mts +3 -1
- package/types/engine/content-spans.d.mts +4 -2
- package/types/engine/current-date.d.mts +9 -0
- package/types/engine/definition-list.d.mts +8 -0
- package/types/engine/frontmatter-lint.d.mts +6 -2
- package/types/engine/index.d.mts +2 -0
- package/types/engine/npc-generate.d.mts +2 -2
- package/types/engine/preview-current-date.d.mts +8 -0
- package/types/engine/site-index.d.mts +5 -1
- package/types/engine/site-preview.d.mts +40 -33
package/engine/site-build.mjs
CHANGED
|
@@ -91,7 +91,8 @@ import { searchableFrontmatter } from "./note-package.mjs";
|
|
|
91
91
|
import { indexRecordsFor } from "./content-index.mjs";
|
|
92
92
|
// A being's computed `age` — see `engine/being-age.mjs`. `pdf-build.mjs`
|
|
93
93
|
// reuses `collectContentPages`'s pages, so wiring it here reaches the book too.
|
|
94
|
-
import { applyComputedBeingAge
|
|
94
|
+
import { applyComputedBeingAge } from "./being-age.mjs";
|
|
95
|
+
import { normalizeCurrentDate } from "./current-date.mjs";
|
|
95
96
|
import { reckoningContext } from "./reckoning-markers.mjs";
|
|
96
97
|
import { resolvedDateFields } from "./note-dates.mjs";
|
|
97
98
|
import { isNoteRecord, noteFile } from "./index-records.mjs";
|
|
@@ -213,9 +214,7 @@ export function collectContentPages(contentBase, ctx) {
|
|
|
213
214
|
const addressFindings = [];
|
|
214
215
|
const fmLinkFindings = [];
|
|
215
216
|
|
|
216
|
-
//
|
|
217
|
-
// and the PDF share — see `engine/being-age.mjs`. `pdf-build.mjs` reaches
|
|
218
|
-
// this through the pages this function returns, so one call covers both.
|
|
217
|
+
// Site and PDF pages use the setting date alongside shared calendar context.
|
|
219
218
|
const records =
|
|
220
219
|
ctx.records ??
|
|
221
220
|
indexRecordsFor({
|
|
@@ -223,7 +222,7 @@ export function collectContentPages(contentBase, ctx) {
|
|
|
223
222
|
config: ctx.config,
|
|
224
223
|
skipDirectories: ctx.skipDirectories,
|
|
225
224
|
});
|
|
226
|
-
const present =
|
|
225
|
+
const present = normalizeCurrentDate(ctx.config?.currentDate);
|
|
227
226
|
const dates = reckoningContext({ notes: records });
|
|
228
227
|
|
|
229
228
|
for (const file of siteCorpusFiles(contentBase, ctx)) {
|
|
@@ -479,6 +478,7 @@ export function siteGates(pages, findings, { config, records, sqlTables }) {
|
|
|
479
478
|
: pages;
|
|
480
479
|
out.index = buildSiteIndex(expanded, {
|
|
481
480
|
package: config.contentPackage,
|
|
481
|
+
currentDate: config.currentDate,
|
|
482
482
|
foreignIndex: foreign.index,
|
|
483
483
|
foreignReferences: foreign.references,
|
|
484
484
|
records,
|
package/engine/site-index.mjs
CHANGED
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
import { NOTE_SYSTEM } from "./systems.mjs";
|
|
69
69
|
import { contentPackage } from "./content-package.mjs";
|
|
70
70
|
import { reckoningContext } from "./reckoning-markers.mjs";
|
|
71
|
-
import {
|
|
71
|
+
import { normalizeCurrentDate } from "./current-date.mjs";
|
|
72
72
|
// The declared tag vocabulary, which is where `draft` is stated.
|
|
73
73
|
import { isGmNote, isDraftNote } from "./note-vocabulary.mjs";
|
|
74
74
|
|
|
@@ -165,6 +165,8 @@ function mergeForeign(index, foreignIndex) {
|
|
|
165
165
|
* @param {readonly SiteEntry[]} entries - Every page the site will publish,
|
|
166
166
|
* each already knowing its own `url`.
|
|
167
167
|
* @param {object} [options] - Cross-package inputs.
|
|
168
|
+
* @param {string} [options.package] - The builder's own content package.
|
|
169
|
+
* @param {string} [options.currentDate="720.1"] - Setting-wide neutral date for recurring events.
|
|
168
170
|
* @param {Map<string, {package: string, type?: string}>} [options.foreignIndex]
|
|
169
171
|
* The merged index from `loadForeignIndexes`. Omit when the build publishes
|
|
170
172
|
* no cross-package links.
|
|
@@ -183,6 +185,7 @@ export function buildSiteIndex(
|
|
|
183
185
|
foreignIndex = new Map(),
|
|
184
186
|
noIndexPackages = new Set(),
|
|
185
187
|
package: builderPackage,
|
|
188
|
+
currentDate,
|
|
186
189
|
records = [],
|
|
187
190
|
foreignReferences = new Map(),
|
|
188
191
|
syntax,
|
|
@@ -303,7 +306,7 @@ export function buildSiteIndex(
|
|
|
303
306
|
// event's `next` is computed against this present.
|
|
304
307
|
dateContext: {
|
|
305
308
|
...reckoningContext({ notes: records }),
|
|
306
|
-
present:
|
|
309
|
+
present: normalizeCurrentDate(currentDate),
|
|
307
310
|
},
|
|
308
311
|
referenceTargets: buildReferenceTargets(records, new Map([...foreignReferences, ...index])),
|
|
309
312
|
index,
|