From 635eea4460bb635766bcf9d0a666b7d5ddb2dba3 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 4 Jun 2021 15:19:03 -0300 Subject: module-ify static pages --- src/page/static.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/page/static.js (limited to 'src/page/static.js') diff --git a/src/page/static.js b/src/page/static.js new file mode 100644 index 0000000..ff57c4f --- /dev/null +++ b/src/page/static.js @@ -0,0 +1,40 @@ +// Static content page specification. (These are static pages coded into the +// wiki data folder, used for a variety of purposes, e.g. wiki info, +// changelog, and so on.) + +// Imports + +import fixWS from 'fix-whitespace'; + +// Page exports + +export function targets({wikiData}) { + return wikiData.staticPageData; +} + +export function write(staticPage, {wikiData}) { + const page = { + type: 'page', + path: ['staticPage', staticPage.directory], + page: ({ + strings, + transformMultiline + }) => ({ + title: staticPage.name, + stylesheet: staticPage.stylesheet, + + main: { + content: fixWS` +
+

${staticPage.name}

+ ${transformMultiline(staticPage.content)} +
+ ` + }, + + nav: {simple: true} + }) + }; + + return [page]; +} -- cgit 1.3.0-6-gf8a5