« get me outta code hell

content: misc content syntax cleanup, mostly attribute merging - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateListingIndexList.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-29 22:59:20 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:36 -0400
commitf400a43640e7106d181d55365a9617c3d12e5891 (patch)
tree91c7911c2f5e91d4a230f807814930761991d23a /src/content/dependencies/generateListingIndexList.js
parent25c434a514152fdd02e5405e4de418cd62614c6a (diff)
content: misc content syntax cleanup, mostly attribute merging
Diffstat (limited to 'src/content/dependencies/generateListingIndexList.js')
-rw-r--r--src/content/dependencies/generateListingIndexList.js33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/content/dependencies/generateListingIndexList.js b/src/content/dependencies/generateListingIndexList.js
index 290295b5..ed153652 100644
--- a/src/content/dependencies/generateListingIndexList.js
+++ b/src/content/dependencies/generateListingIndexList.js
@@ -81,16 +81,18 @@ export default {
               listingStringsKey: listingStringsKeys,
             }).map(({listingLink, listingStringsKey}, listingIndex) =>
                 html.tag('li',
-                  {class:
-                    targetIndex === data.currentTargetIndex &&
-                    listingIndex === data.currentListingIndex &&
-                      'current'},
-                  listingLink
-                    .slot('content', language.$(`listingPage.${listingStringsKey}.title.short`))))));
+                  targetIndex === data.currentTargetIndex &&
+                  listingIndex === data.currentListingIndex &&
+                    {class: 'current'},
+
+                  listingLink.slots({
+                    content:
+                      language.$('listingPage', listingStringsKey, 'title.short'),
+                  })))));
 
     const targetTitles =
       data.targetStringsKeys
-        .map(stringsKey => language.$(`listingPage.target.${stringsKey}`));
+        .map(stringsKey => language.$('listingPage.target', stringsKey));
 
     switch (slots.mode) {
       case 'sidebar':
@@ -100,13 +102,13 @@ export default {
             listingLinkList: listingLinkLists,
           }).map(({targetTitle, listingLinkList}, targetIndex) =>
               html.tag('details',
-                {
-                  open: targetIndex === data.currentTargetIndex,
-                  class: targetIndex === data.currentTargetIndex && 'current',
-                },
+                targetIndex === data.currentTargetIndex &&
+                  {class: 'current', open: true},
+
                 [
                   html.tag('summary',
-                    html.tag('span', {class: 'group-name'}, targetTitle)),
+                    html.tag('span', {class: 'group-name'},
+                      targetTitle)),
 
                   listingLinkList,
                 ])));
@@ -118,8 +120,11 @@ export default {
               targetTitle: targetTitles,
               listingLinkList: listingLinkLists,
             }).map(({targetTitle, listingLinkList}) => [
-                html.tag('dt', {class: ['content-heading']}, targetTitle),
-                html.tag('dd', listingLinkList),
+                html.tag('dt', {class: 'content-heading'},
+                  targetTitle),
+
+                html.tag('dd',
+                  listingLinkList),
               ])));
     }
   },