« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generatePageLayout.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index cc74a600..67cb9d95 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -377,18 +377,18 @@ export default {
                 content));
       }
 
+      if (html.isBlank(sidebarContent)) {
+        return html.blank();
+      }
+
       return html.tag('div',
-        {
-          [html.onlyIfContent]: true,
-          id,
-          class: [
-            'sidebar-column',
-            wide && 'wide',
-            !collapse && 'no-hide',
-            stickyMode !== 'static' && `sticky-${stickyMode}`,
-            ...sidebarClasses,
-          ],
-        },
+        {id, class: [
+          'sidebar-column',
+          wide && 'wide',
+          !collapse && 'no-hide',
+          stickyMode !== 'static' && `sticky-${stickyMode}`,
+          ...sidebarClasses,
+        ]},
         sidebarContent);
     }
 
@@ -422,20 +422,20 @@ export default {
             processSkippers([
               {condition: true, id: 'content', string: 'content'},
               {
-                condition: sidebarLeftHTML,
+                condition: !html.isBlank(sidebarLeftHTML),
                 id: 'sidebar-left',
                 string:
-                  (sidebarRightHTML
-                    ? 'sidebar.left'
-                    : 'sidebar'),
+                  (html.isBlank(sidebarRightHTML)
+                    ? 'sidebar'
+                    : 'sidebar.left'),
               },
               {
-                condition: sidebarRightHTML,
+                condition: !html.isBlank(sidebarRightHTML),
                 id: 'sidebar-right',
                 string:
-                  (sidebarLeftHTML
-                    ? 'sidebar.right'
-                    : 'sidebar'),
+                  (html.isBlank(sidebarLeftHTML)
+                    ? 'sidebar'
+                    : 'sidebar.right'),
               },
               {condition: navHTML, id: 'header', string: 'header'},
               {condition: footerHTML, id: 'footer', string: 'footer'},