« get me outta code hell

content: generatePageLayout: only show search if available - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-01 21:27:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:11:47 -0300
commit1df0ffc354736c3ab776ad3d394b81e942c0f984 (patch)
treebfa5234d28c70b2ceaed23d6ee89c4855738348f /src/content
parentce56dec7da53739f8c02e6ddf6a8e1ebe4b245b2 (diff)
content: generatePageLayout: only show search if available
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generatePageLayout.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index f4b7e7a7..eb9b9dc4 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -21,6 +21,7 @@ export default {
 
   sprawl({wikiInfo}) {
     return {
+      enableSearch: wikiInfo.enableSearch,
       footerContent: wikiInfo.footerContent,
       wikiColor: wikiInfo.color,
       wikiName: wikiInfo.nameShort,
@@ -43,8 +44,10 @@ export default {
     relations.stickyHeadingContainer =
       relation('generateStickyHeadingContainer');
 
-    relations.searchBox =
-      relation('generateSearchSidebarBox');
+    if (sprawl.enableSearch) {
+      relations.searchBox =
+        relation('generateSearchSidebarBox');
+    }
 
     if (sprawl.footerContent) {
       relations.defaultFooterContent =
@@ -394,7 +397,11 @@ export default {
     const leftSidebar = getSidebar('leftSidebar', 'sidebar-left');
     const rightSidebar = getSidebar('rightSidebar', 'sidebar-right');
 
-    if (slots.showSearch && !html.isBlank(leftSidebar)) {
+    if (
+      slots.showSearch &&
+      relations.searchBox &&
+      !html.isBlank(leftSidebar)
+    ) {
       leftSidebar.setSlot('boxes',
         html.tags([
           relations.searchBox,