« get me outta code hell

content: generateListingPage: add chunkTitleAccents slot - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateListingPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-09 16:34:15 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-09 16:34:15 -0400
commitf187e32c858e46af9ee2717a20ae4095f0fef325 (patch)
tree2febbd8c4fdb23d1a668358eb806b1489761a8f9 /src/content/dependencies/generateListingPage.js
parent869548723002ebf2f3a501c4105cdf6db7ac8aa7 (diff)
content: generateListingPage: add chunkTitleAccents slot
Diffstat (limited to 'src/content/dependencies/generateListingPage.js')
-rw-r--r--src/content/dependencies/generateListingPage.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/content/dependencies/generateListingPage.js b/src/content/dependencies/generateListingPage.js
index 6eee45b..b3d6899 100644
--- a/src/content/dependencies/generateListingPage.js
+++ b/src/content/dependencies/generateListingPage.js
@@ -78,6 +78,10 @@ export default {
       validate: v => v.strictArrayOf(v.isObject),
     },
 
+    chunkTitleAccents: {
+      validate: v => v.strictArrayOf(v.optional(v.isObject)),
+    },
+
     chunkRows: {
       validate: v => v.strictArrayOf(v.isObject),
     },
@@ -218,10 +222,11 @@ export default {
 
             stitchArrays({
               title: slots.chunkTitles,
+              titleAccent: slots.chunkTitleAccents,
               id: slots.chunkIDs,
               rows: slots.chunkRows,
               rowAttributes: slots.chunkRowAttributes,
-            }).map(({title, id, rows, rowAttributes}) => [
+            }).map(({title, titleAccent, id, rows, rowAttributes}) => [
                 relations.chunkHeading
                   .clone()
                   .slots({
@@ -233,6 +238,13 @@ export default {
                         context: 'chunk.title',
                         provided: title,
                       }),
+
+                    accent:
+                      titleAccent &&
+                        formatListingString({
+                          context: ['chunk.title', title.stringsKey, 'accent'],
+                          provided: titleAccent,
+                        }),
                   }),
 
                 html.tag('dd',