« get me outta code hell

content, data: generateRelationsContentHeading, Track.nameStyle - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateContentContentHeading.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-05-11 19:00:59 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-05-11 19:00:59 -0300
commit657e1c1e447ad8939d2ad9286af00be52975f791 (patch)
tree8f471ff45bad3f1890357f8cbe54c75e5b01fb09 /src/content/dependencies/generateContentContentHeading.js
parent38672451c0f2380093283156609018cce789bb50 (diff)
content, data: generateRelationsContentHeading, Track.nameStyle
Diffstat (limited to 'src/content/dependencies/generateContentContentHeading.js')
-rw-r--r--src/content/dependencies/generateContentContentHeading.js32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/content/dependencies/generateContentContentHeading.js b/src/content/dependencies/generateContentContentHeading.js
index 9ed2d9f0..44053427 100644
--- a/src/content/dependencies/generateContentContentHeading.js
+++ b/src/content/dependencies/generateContentContentHeading.js
@@ -6,9 +6,10 @@ export default {
 
   data: (thing) => ({
     name:
-      (thing
-        ? thing.name
-        : null),
+      (thing ? thing.name : null),
+
+    nameStyle:
+      (thing ? thing.nameStyle : null),
   }),
 
   slots: {
@@ -32,33 +33,40 @@ export default {
       attributes: slots.attributes,
 
       title:
-        (() => {
+        language.encapsulate(slots.string, workingCapsule => {
           if (!slots.string) return html.blank();
 
-          const options = {};
+          const workingOptions = {};
 
           if (slots.summary) {
-            options.cue =
+            workingOptions.cue =
               html.tag('span', {class: 'cue'},
                 language.$(slots.string, 'cue'));
           }
 
-          if (data.name) {
-            options.thing = html.tag('i', data.name);
+          const name =
+            (data.nameStyle === 'utility'
+              ? null
+              : data.name);
+
+          if (name) {
+            workingOptions.thing = html.tag('i', name);
+          } else {
+            workingCapsule += '.withoutName';
           }
 
           if (slots.summary) {
             return html.tags([
               html.tag('span', {class: 'when-open'},
-                language.$(slots.string, options)),
+                language.$(workingCapsule, workingOptions)),
 
               html.tag('span', {class: 'when-collapsed'},
-                language.$(slots.string, 'collapsed', options)),
+                language.$(workingCapsule, 'collapsed', workingOptions)),
             ]);
           } else {
-            return language.$(slots.string, options);
+            return language.$(workingCapsule, workingOptions);
           }
-        })(),
+        }),
 
       stickyTitle:
         (slots.string