« get me outta code hell

content: generatePageLayout: showing-sidebar-{left,right} - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-30 22:12:33 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:11:58 -0300
commit510db039aa51c42b139bf5a1e80a0aef7571cd3d (patch)
treead3781cd014fc01f7639ffcfa65ac8b3f8ad355c /src
parent395d181328543f0cfa155dfc49b93fd116f20a47 (diff)
content: generatePageLayout: showing-sidebar-{left,right}
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generatePageLayout.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index ad05cc94..0a96a19d 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -394,6 +394,9 @@ export default {
                 .with({id}),
           }));
 
+    let showingSidebarLeft;
+    let showingSidebarRight;
+
     const leftSidebar = getSidebar('leftSidebar', 'sidebar-left');
     const rightSidebar = getSidebar('rightSidebar', 'sidebar-right');
 
@@ -412,6 +415,9 @@ export default {
     const hasSidebarLeft = !html.isBlank(html.resolve(leftSidebar));
     const hasSidebarRight = !html.isBlank(html.resolve(rightSidebar));
 
+    showingSidebarLeft ??= hasSidebarLeft;
+    showingSidebarRight ??= hasSidebarRight;
+
     const processSkippers = skipperList =>
       skipperList
         .filter(({condition, id}) =>
@@ -663,6 +669,12 @@ export default {
                 hasSidebarRight &&
                   {class: 'has-sidebar-right'},
 
+                showingSidebarLeft &&
+                  {class: 'showing-sidebar-left'},
+
+                showingSidebarRight &&
+                  {class: 'showing-sidebar-right'},
+
                 [
                   skippersHTML,
                   layoutHTML,