« get me outta code hell

specify homepage navbar links & order in data - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-01 17:43:35 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-01 17:43:35 -0400
commita312b897e99251ff9d53014dbb86c7a3b7b6609c (patch)
tree46aa97345bd6d4905988d052c0d3271abc65b39a /src/util
parent2fb4acd20a5b311e5f3f8581eb58687ed9cc2d1f (diff)
specify homepage navbar links & order in data
...rather than just making a guess off the order files are listed
by directory access, and using out-of-place 'Show in Navigation
Bar'
Diffstat (limited to 'src/util')
-rw-r--r--src/util/link.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/link.js b/src/util/link.js
index 7d53edc3..e692255a 100644
--- a/src/util/link.js
+++ b/src/util/link.js
@@ -38,6 +38,7 @@ const linkHelper =
     class: className = '',
     color: color2 = true,
     hash = '',
+    preferShortName = false,
   }) => {
     let href = hrefFn(thing, {to});
 
@@ -65,7 +66,10 @@ const linkHelper =
             : '',
         class: className,
       },
-      text || thing.name
+      (text ||
+        (preferShortName
+          ? thing.nameShort ?? thing.name
+          : thing.name))
     );
   };