From be094714ca09607db32274bf2aa66e6d5bd59722 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 14 Aug 2023 00:00:13 -0300 Subject: content: generatePageLayout: present sidebars in skipper properly --- src/content/dependencies/generatePageLayout.js | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/content') 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'}, -- cgit 1.3.0-6-gf8a5