« get me outta code hell

content, css, client: use a static inert clone - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-04-06 11:50:42 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-06 11:50:42 -0300
commit50d0b505af8ed2038dc0f6ee01b8ba04b04310eb (patch)
treeca177b1f4376b6066cb7b15f92a20a422d5b7282 /src/content
parent451171990f86c4d454109edd54eb2b8a76e9ed89 (diff)
content, css, client: use a static inert clone
...rather than a static mock, which wasn't *quite* matching
the real deal's world wrap every time
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generatePageLayout.js14
-rw-r--r--src/content/dependencies/generateStickyHeadingContainer.js12
2 files changed, 17 insertions, 9 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index a45f7415..d667a6f4 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -276,10 +276,16 @@ export default {
       (html.isBlank(slots.title)
         ? null
      : slots.headingMode === 'sticky'
-        ? relations.stickyHeadingContainer.slots({
-            title: titleContentsHTML,
-            cover: slots.cover,
-          })
+        ? [
+            relations.stickyHeadingContainer.slots({
+              title: titleContentsHTML,
+              cover: slots.cover,
+            }),
+
+            relations.stickyHeadingContainer.clone().slots({
+              rootAttributes: {inert: true},
+            }),
+          ]
         : html.tag('h1', titleContentsHTML));
 
     // TODO: There could be neat interactions with the sticky heading here,
diff --git a/src/content/dependencies/generateStickyHeadingContainer.js b/src/content/dependencies/generateStickyHeadingContainer.js
index f58b0cd8..64becc5e 100644
--- a/src/content/dependencies/generateStickyHeadingContainer.js
+++ b/src/content/dependencies/generateStickyHeadingContainer.js
@@ -2,6 +2,11 @@ export default {
   extraDependencies: ['html'],
 
   slots: {
+    rootAttributes: {
+      type: 'attributes',
+      mutable: false,
+    },
+
     title: {
       type: 'html',
       mutable: false,
@@ -15,6 +20,8 @@ export default {
 
   generate: (slots, {html}) => html.tags([
     html.tag('div', {class: 'content-sticky-heading-root'},
+      slots.rootAttributes,
+
       !html.isBlank(slots.cover) &&
         {class: 'has-cover'},
 
@@ -48,10 +55,5 @@ export default {
             html.tag('div', {class: 'content-sticky-subheading-row'},
               html.tag('h2', {class: 'content-sticky-subheading'})),
           ]))),
-
-    html.tag('h1', {class: 'imaginary-static-heading-root'},
-      html.tag('span', {class: 'imaginary-static-heading-row'},
-        html.tag('span', {class: 'imaginary-static-heading-title'},
-          slots.title.clone()))),
   ]),
 };