From f39c6352acc3110c41fe4958c3cd1c083169a3f6 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Wed, 5 Jun 2024 21:51:49 -0300 Subject: [PATCH] chore(website): make carbon work on blog pages --- website/docusaurus.config.ts | 5 ++++- website/static/js/carbon.js | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 96e3946c..663047b5 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -64,7 +64,10 @@ const config: Config = { } } }, - blog: {}, + blog: { + blogSidebarTitle: 'All posts', + blogSidebarCount: 'ALL' + }, theme: { customCss: [ './src/css/custom.css', diff --git a/website/static/js/carbon.js b/website/static/js/carbon.js index a9a56071..25cf015e 100644 --- a/website/static/js/carbon.js +++ b/website/static/js/carbon.js @@ -1,6 +1,14 @@ (function () { function attachAd() { var wrapper = document.getElementById('sidebar-ads'); + var blogSidebar = document.querySelector('[class*="BlogSidebar"]'); + + if (!wrapper && blogSidebar) { + wrapper = document.createElement('div'); + wrapper.id = 'sidebar-ads'; + blogSidebar.appendChild(wrapper); + } + if (wrapper) { var el = document.createElement('script'); el.setAttribute('type', 'text/javascript');