« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/homepage.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/homepage.js')
-rw-r--r--src/page/homepage.js31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/page/homepage.js b/src/page/homepage.js
index d34f117..882daf7 100644
--- a/src/page/homepage.js
+++ b/src/page/homepage.js
@@ -1,6 +1,10 @@
 // Homepage specification.
 
-import {empty} from '../util/sugar.js';
+import {
+  bindOpts,
+  empty,
+  withEntries,
+} from '../util/sugar.js';
 
 import {
   getNewAdditions,
@@ -193,21 +197,16 @@ export function writeTargetless({wikiData}) {
         links: [
           link.home('', {text: wikiInfo.nameShort, class: 'current', to}),
 
-          wikiInfo.enableListings &&
-            link.listingIndex('', {
-              text: language.$('listingIndex.title'),
-              to,
-            }),
-
-          wikiInfo.enableNews &&
-            link.newsIndex('', {text: language.$('newsIndex.title'), to}),
-
-          wikiInfo.enableFlashesAndGames &&
-            link.flashIndex('', {text: language.$('flashIndex.title'), to}),
-
-          ...staticPageData
-            .filter((page) => page.showInNavigationBar)
-            .map((page) => link.staticPage(page, {text: page.nameShort})),
+          ...html.fragment(
+            homepageLayout.navbarLinks?.map(text =>
+              transformInline(text, {
+                link:
+                  withEntries(link, entries =>
+                    entries.map(([key, fn]) =>
+                      [key, bindOpts(fn, {
+                        preferShortName: true,
+                      })])),
+              }))),
         ]
           .filter(Boolean)
           .map((html) => ({html})),