« get me outta code hell

only show homepage nav links for enabled features - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-03-03 12:48:12 -0400
committer(quasar) nebula <towerofnix@gmail.com>2021-03-03 12:48:12 -0400
commit5d70e99ac2b15630a436bf9d36772b2e0c9c19d3 (patch)
tree8b370f60d0bf1bd7a344862249aaf13002c66c06
parent08d94ebcc6ae0ab7a4d28019b3428cb53f0ca1b7 (diff)
only show homepage nav links for enabled features
-rwxr-xr-xupd8.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/upd8.js b/upd8.js
index e8befa6a..8f40c45e 100755
--- a/upd8.js
+++ b/upd8.js
@@ -2377,11 +2377,14 @@ function writeHomepage() {
                 <h2 class="dot-between-spans">
                     ${[
                         strings.link.home('', {text: wikiInfo.shortName, class: 'current', to}),
+                        wikiInfo.features.listings &&
                         strings.link.listingIndex('', {text: strings('listingIndex.title'), to}),
+                        wikiInfo.features.news &&
                         strings.link.newsIndex('', {text: strings('newsIndex.title'), to}),
+                        wikiInfo.features.flashesAndGames &&
                         strings.link.flashIndex('', {text: strings('flashIndex.title'), to}),
                         ...staticPageData.filter(page => page.listed).map(page => strings.link.staticPage(page, {to}))
-                    ].map(link => `<span>${link}</span>`).join('\n')}
+                    ].filter(Boolean).map(link => `<span>${link}</span>`).join('\n')}
                 </h2>
             `
         }