« get me outta code hell

content: generateChronologyLinks: sort most-to-least - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateChronologyLinks.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-23 16:41:33 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-30 20:48:17 -0300
commit9d655c9a4c910a9dc02eceb850d393832a105fba (patch)
treeed6b09230882ef7f014f80697f7b1c5d9124b16f /src/content/dependencies/generateChronologyLinks.js
parent53483407a9f1f7fe20db6574fd4127d0c875e2ce (diff)
content: generateChronologyLinks: sort most-to-least
Diffstat (limited to 'src/content/dependencies/generateChronologyLinks.js')
-rw-r--r--src/content/dependencies/generateChronologyLinks.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/content/dependencies/generateChronologyLinks.js b/src/content/dependencies/generateChronologyLinks.js
index bd798849..19c33be6 100644
--- a/src/content/dependencies/generateChronologyLinks.js
+++ b/src/content/dependencies/generateChronologyLinks.js
@@ -19,6 +19,7 @@ export default {
               artistLink: v.isHTML,
               previousLink: v.isHTML,
               nextLink: v.isHTML,
+              only: v.isBoolean,
             })),
           })),
     }
@@ -37,8 +38,7 @@ export default {
           ...entry,
           contributions:
             contributions
-              .filter(({nextLink, previousLink}) =>
-                nextLink || previousLink),
+              .filter(({only}) => !only),
         }))
         .filter(({contributions}) => !empty(contributions));
     }
@@ -67,20 +67,21 @@ export default {
           artistLink,
           previousLink,
           nextLink,
+          only,
         }) => {
           const heading =
             html.tag('span', {class: 'heading'},
               language.$(headingString, {
                 index:
-                  (previousLink || nextLink
-                    ? language.formatIndex(index)
-                    : language.formatString('misc.chronology.heading.onlyIndex')),
+                  (only
+                    ? language.formatString('misc.chronology.heading.onlyIndex')
+                    : language.formatIndex(index)),
 
                 artist: artistLink,
               }));
 
           const navigation =
-            (previousLink || nextLink) &&
+            !only &&
               html.tag('span', {class: 'buttons'},
                 language.formatUnitList([
                   previousLink?.slots({