diff --git a/site.ts b/site.ts index e0afa70..54e22fa 100644 --- a/site.ts +++ b/site.ts @@ -40,7 +40,15 @@ site.data("color", color); site.add("."); -site.process([".html"], (pages) => { +site.preprocess([".html"], (pages) => + pages.forEach((page) => { + page.data.title = page.data.title ?? + page.data.basename + .replace(/-/g, " ") + .replace(/\b\w/g, (char) => char.toUpperCase()); + })); + +site.process([".html"], (pages) => pages.forEach((page) => { const document = page.document; @@ -156,8 +164,7 @@ site.process([".html"], (pages) => { footnotes.remove(); } } - }); -}); + })); site.use(extractDate()); site.use(redirects()); diff --git a/site/_includes/map.vto b/site/_includes/map.vto index d3411c1..6c007ec 100644 --- a/site/_includes/map.vto +++ b/site/_includes/map.vto @@ -1,6 +1,6 @@ {{ function process(entry, toplevel = false) }}
- {{ if entry.data.title }} + {{ if entry.data.url }}