From a312b897e99251ff9d53014dbb86c7a3b7b6609c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 1 Jan 2023 17:43:35 -0400 Subject: 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' --- src/page/homepage.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/page/homepage.js') diff --git a/src/page/homepage.js b/src/page/homepage.js index d34f117b..882daf72 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})), -- cgit 1.3.0-6-gf8a5