« get me outta code hell

content: generatePageLayout: styleTags alongside styleRules - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-27 16:27:05 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-27 16:27:05 -0300
commit985e0174c58bf75268cb278b4319a26fdd4bc42d (patch)
tree20c9fc83444d40bba99ff641c8508a09cfc78c56
parent97a5454d43cc76692688208dae21be8eece18a31 (diff)
content: generatePageLayout: styleTags alongside styleRules
-rw-r--r--src/content/dependencies/generatePageLayout.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index 59c0be5f..147e2a5e 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -120,6 +120,11 @@ export default {
       default: [],
     },
 
+    styleTags: {
+      type: 'html',
+      mutable: false,
+    },
+
     mainClasses: {
       validate: v => v.sparseArrayOf(v.isString),
       default: [],
@@ -594,11 +599,13 @@ export default {
             ])),
         ]);
 
-    const fakeStyleTags =
-      slots.styleRules.map(rule => html.tag('style', rule));
+    const slottedStyleTags = html.tags([
+      slots.styleRules.map(rule => html.tag('style', rule)),
+      slots.styleTags,
+    ]);
 
     const styleTagsCSS =
-      html.smush(/*slots.styleTags*/ fakeStyleTags)
+      html.smush(slottedStyleTags)
         .content
         .map(tag =>
           html.resolve(tag.content, {normalize: 'string'}))
@@ -762,7 +769,7 @@ export default {
 
             fallbackWallpaperStyleTag,
 
-            fakeStyleTags,
+            slottedStyleTags,
 
             html.tag('script', {
               src: to('staticLib.path', 'chroma-js/chroma.min.js'),