From 29ff9c7b273f940531707db7ecf1811711bcb68f Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:38:23 +0200 Subject: [PATCH 1/2] fix: remove extra top margin in the toc when there is no message block Only apply an extra top margin when the HTML generation that a message block is used. --- src/helpers/isMessageBlockDisplayed.js | 9 +++++++++ src/partials/toc.hbs | 2 +- src/partials/toolbar.hbs | 2 ++ src/stylesheets/globals/vars.scss | 4 +++- src/stylesheets/toc.scss | 9 +++++++++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/helpers/isMessageBlockDisplayed.js diff --git a/src/helpers/isMessageBlockDisplayed.js b/src/helpers/isMessageBlockDisplayed.js new file mode 100644 index 00000000..f56b03fd --- /dev/null +++ b/src/helpers/isMessageBlockDisplayed.js @@ -0,0 +1,9 @@ +'use strict' + + +module.exports = (page) => { + // To keep in sync with the message blocks that are supported (see partials/toolbar.hbs) + return page.attributes?.['next-release'] || + page.attributes?.['custom-message'] || + page.attributes?.['out-of-support'] +} diff --git a/src/partials/toc.hbs b/src/partials/toc.hbs index 2b291908..1825a1bb 100644 --- a/src/partials/toc.hbs +++ b/src/partials/toc.hbs @@ -1,3 +1,3 @@ -