From b6cba67c7acd79affb2449f5c8582b6b1fe928ac Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 26 May 2023 14:10:48 -0300 Subject: content: generateStaticPage --- src/content/dependencies/generateStaticPage.js | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/content/dependencies/generateStaticPage.js (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateStaticPage.js b/src/content/dependencies/generateStaticPage.js new file mode 100644 index 00000000..e3063ff8 --- /dev/null +++ b/src/content/dependencies/generateStaticPage.js @@ -0,0 +1,36 @@ +export default { + contentDependencies: ['generatePageLayout', 'transformContent'], + + relations(relation, staticPage) { + return { + layout: relation('generatePageLayout'), + content: relation('transformContent', staticPage.content), + }; + }, + + data(staticPage) { + return { + name: staticPage.name, + stylesheet: staticPage.stylesheet, + }; + }, + + generate(data, relations) { + return relations.layout + .slots({ + title: data.name, + headingMode: 'sticky', + + styleRules: [data.stylesheet].filter(Boolean), + + mainClasses: ['long-content'], + mainContent: relations.content, + + navLinkStyle: 'hierarchical', + navLinks: [ + {auto: 'home'}, + {auto: 'current'}, + ], + }); + }, +}; -- cgit 1.3.0-6-gf8a5