« get me outta code hell

content: specify mutable across html & attributes slots - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generatePageLayout.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-01 13:47:10 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-01 20:06:23 -0400
commitf53b9df7452ef886cf85db5bb72a48f32dce3dbb (patch)
treee173634830626d1d25b59c04600966f878f47c3c /src/content/dependencies/generatePageLayout.js
parente0defee7f7ab50bf3e6d33d6ab04f6c6795bab27 (diff)
content: specify mutable across html & attributes slots
Diffstat (limited to 'src/content/dependencies/generatePageLayout.js')
-rw-r--r--src/content/dependencies/generatePageLayout.js65
1 files changed, 53 insertions, 12 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index 3ed6631..0d2ce55 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -4,7 +4,10 @@ function sidebarSlots(side) {
   return {
     // Content is a flat HTML array. It'll generate one sidebar section
     // if specified.
-    [side + 'Content']: {type: 'html'},
+    [side + 'Content']: {
+      type: 'html',
+      mutable: false,
+    },
 
     // A single class to apply to the whole sidebar. If specifying multiple
     // sections, this be added to the containing sidebar-column - specify a
@@ -105,14 +108,32 @@ export default {
   },
 
   slots: {
-    title: {type: 'html'},
-    showWikiNameInTitle: {type: 'boolean', default: true},
+    title: {
+      type: 'html',
+      mutable: false,
+    },
+
+    showWikiNameInTitle: {
+      type: 'boolean',
+      default: true,
+    },
 
-    additionalNames: {type: 'html'},
+    additionalNames: {
+      type: 'html',
+      mutable: false,
+    },
 
-    cover: {type: 'html'},
+    cover: {
+      type: 'html',
+      mutable: false,
+    },
 
-    socialEmbed: {type: 'html'},
+    // Strictly speaking we clone this each time we use it, so it doesn't
+    // need to be marked as mutable here.
+    socialEmbed: {
+      type: 'html',
+      mutable: true,
+    },
 
     color: {validate: v => v.isColor},
 
@@ -128,7 +149,10 @@ export default {
 
     // Main
 
-    mainContent: {type: 'html'},
+    mainContent: {
+      type: 'html',
+      mutable: false,
+    },
 
     headingMode: {
       validate: v => v.is('sticky', 'static'),
@@ -142,7 +166,11 @@ export default {
 
     // Banner
 
-    banner: {type: 'html'},
+    banner: {
+      type: 'html',
+      mutable: false,
+    },
+
     bannerPosition: {
       validate: v => v.is('top', 'bottom'),
       default: 'top',
@@ -150,8 +178,15 @@ export default {
 
     // Nav & Footer
 
-    navContent: {type: 'html'},
-    navBottomRowContent: {type: 'html'},
+    navContent: {
+      type: 'html',
+      mutable: false,
+    },
+
+    navBottomRowContent: {
+      type: 'html',
+      mutable: false,
+    },
 
     navLinkStyle: {
       validate: v => v.is('hierarchical', 'index'),
@@ -208,9 +243,15 @@ export default {
         })
     },
 
-    secondaryNav: {type: 'html'},
+    secondaryNav: {
+      type: 'html',
+      mutable: false,
+    },
 
-    footerContent: {type: 'html'},
+    footerContent: {
+      type: 'html',
+      mutable: false,
+    },
   },
 
   generate(data, relations, slots, {