« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateAlbumSecondaryNav.js6
-rw-r--r--src/content/dependencies/generateGroupSecondaryNav.js2
-rw-r--r--src/content/dependencies/generateSecondaryNav.js7
3 files changed, 8 insertions, 7 deletions
diff --git a/src/content/dependencies/generateAlbumSecondaryNav.js b/src/content/dependencies/generateAlbumSecondaryNav.js
index 79a26b19..2585e171 100644
--- a/src/content/dependencies/generateAlbumSecondaryNav.js
+++ b/src/content/dependencies/generateAlbumSecondaryNav.js
@@ -109,11 +109,11 @@ export default {
     return relations.secondaryNav.slots({
       alwaysVisible: slots.alwaysVisible,
 
-      class: [
-        'album-secondary-nav',
+      attributes: [
+        {class: 'album-secondary-nav'},
 
         slots.mode === 'album' &&
-          'with-previous-next',
+          {class: 'with-previous-next'},
       ],
 
       content:
diff --git a/src/content/dependencies/generateGroupSecondaryNav.js b/src/content/dependencies/generateGroupSecondaryNav.js
index 1d21ab1c..c48f3142 100644
--- a/src/content/dependencies/generateGroupSecondaryNav.js
+++ b/src/content/dependencies/generateGroupSecondaryNav.js
@@ -14,7 +14,7 @@ export default {
 
   generate: (relations) =>
     relations.secondaryNav.slots({
-      class: 'nav-links-groups',
+      attributes: {class: 'nav-links-groups'},
       content: relations.categoryPart,
     }),
 };
diff --git a/src/content/dependencies/generateSecondaryNav.js b/src/content/dependencies/generateSecondaryNav.js
index f4081e70..9ce7ce9b 100644
--- a/src/content/dependencies/generateSecondaryNav.js
+++ b/src/content/dependencies/generateSecondaryNav.js
@@ -7,8 +7,9 @@ export default {
       mutable: false,
     },
 
-    class: {
-      validate: v => v.anyOf(v.isString, v.sparseArrayOf(v.isString)),
+    attributes: {
+      type: 'attributes',
+      mutable: false,
     },
 
     alwaysVisible: {
@@ -20,7 +21,7 @@ export default {
   generate: (slots, {html}) =>
     html.tag('nav', {id: 'secondary-nav'},
       {[html.onlyIfContent]: true},
-      {class: slots.class},
+      slots.attributes,
 
       slots.alwaysVisible &&
         {class: 'always-visible'},