File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ const config = {
3333 'data-website-id' : 'c15ead0d-e003-4fe0-8647-ddf0b560e38c' ,
3434 defer : true ,
3535 } ,
36+ {
37+ src : 'https://media.ethicalads.io/media/client/ethicalads.min.js' ,
38+ async : true ,
39+ type : 'text/javascript' ,
40+ }
3641 ] ,
3742
3843 presets : [
Original file line number Diff line number Diff line change @@ -44,3 +44,13 @@ html[data-theme='dark'] .docusaurus-highlight-code-line {
4444 max-width : 2440px ;
4545 }
4646}
47+
48+ .menu {
49+ display : flex;
50+ flex-direction : column;
51+ justify-content : space-between;
52+ }
53+
54+ # eab {
55+ margin : calc (var (--ifm-menu-link-padding-horizontal ) + 0.5rem ) 0 0 -0.5rem ;
56+ }
Original file line number Diff line number Diff line change 1+ import React , { useEffect , useRef } from 'react' ;
2+ import { useColorMode } from '@docusaurus/theme-common' ;
3+ import OriginalDocSidebar from '@theme-original/DocSidebar' ;
4+
5+ export default function DocSidebar ( props ) {
6+ const bannerRef = useRef ( ) ;
7+ const { colorMode } = useColorMode ( ) ;
8+
9+ useEffect ( ( ) => {
10+ if ( ! document . getElementById ( 'eab' ) ) {
11+ const banner = document . createElement ( 'div' ) ;
12+
13+ bannerRef . current = banner ;
14+ banner . className = 'flat horizontal'
15+ banner . id = 'eab' ;
16+ banner . setAttribute ( 'data-ea-publisher' , 'react-chartjs-2jsorg' ) ;
17+ banner . setAttribute ( 'data-ea-type' , 'image' ) ;
18+ document . querySelector ( '.theme-doc-sidebar-menu' ) ?. parentElement ?. appendChild ( banner ) ;
19+ ethicalads . reload ( ) ;
20+ }
21+ } , [ ] ) ;
22+
23+ useEffect ( ( ) => {
24+ bannerRef . current ?. classList . toggle ( 'dark' , colorMode === 'dark' ) ;
25+ } , [ colorMode ] ) ;
26+
27+ return (
28+ < OriginalDocSidebar { ...props } />
29+ ) ;
30+ }
You can’t perform that action at this time.
0 commit comments