Skip to content

Commit f39c635

Browse files
committed
chore(website): make carbon work on blog pages
1 parent 4294cc9 commit f39c635

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

website/docusaurus.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ const config: Config = {
6464
}
6565
}
6666
},
67-
blog: {},
67+
blog: {
68+
blogSidebarTitle: 'All posts',
69+
blogSidebarCount: 'ALL'
70+
},
6871
theme: {
6972
customCss: [
7073
'./src/css/custom.css',

website/static/js/carbon.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
(function () {
22
function attachAd() {
33
var wrapper = document.getElementById('sidebar-ads');
4+
var blogSidebar = document.querySelector('[class*="BlogSidebar"]');
5+
6+
if (!wrapper && blogSidebar) {
7+
wrapper = document.createElement('div');
8+
wrapper.id = 'sidebar-ads';
9+
blogSidebar.appendChild(wrapper);
10+
}
11+
412
if (wrapper) {
513
var el = document.createElement('script');
614
el.setAttribute('type', 'text/javascript');

0 commit comments

Comments
 (0)