« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generatePageTitleText.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generatePageTitleText.js')
-rw-r--r--src/content/dependencies/generatePageTitleText.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/content/dependencies/generatePageTitleText.js b/src/content/dependencies/generatePageTitleText.js
index 5482ca91..112112e6 100644
--- a/src/content/dependencies/generatePageTitleText.js
+++ b/src/content/dependencies/generatePageTitleText.js
@@ -14,6 +14,11 @@ export default {
       mutable: false,
     },
 
+    detail: {
+      type: 'html',
+      mutable: false,
+    },
+
     showWikiNameInTitle: {
       validate: v => v.is(true, false, 'auto'),
       default: 'auto',
@@ -38,9 +43,18 @@ export default {
       // so we wrap the title in a tag and pass it off as good to go.
       workingOptions.title =
         html.tags([
-striptags(slots.title.toString()),
+          striptags(slots.title.toString()),
         ]);
 
+      if (!html.isBlank(slots.detail)) {
+        // Same shenanigans here, as far as wrapping striptags goes.
+        workingCapsule += '.withDetail';
+        workingOptions.detail =
+          html.tags([
+            striptags(slots.detail.toString()),
+          ]);
+      }
+
       if (!html.isBlank(slots.subtitle)) {
         // Same shenanigans here, as far as wrapping striptags goes.
         workingCapsule += '.withSubtitle';
@@ -52,10 +66,13 @@ striptags(slots.title.toString()),
 
       const showWikiName =
         (slots.showWikiNameInTitle === true
-? true
+          ? true
+
        : slots.showWikiNameInTitle === 'auto'
-? html.isBlank(slots.subtitle)
-: false);
+          ? html.isBlank(slots.subtitle) &&
+            html.isBlank(slots.detail)
+
+          : false);
 
       if (showWikiName) {
         workingCapsule += '.withWikiName';
@@ -64,4 +81,4 @@ striptags(slots.title.toString()),
 
       return language.$(workingCapsule, workingOptions);
     }),
-};
\ No newline at end of file
+};