File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export default defineUserConfig({
2525 ] ,
2626
2727 theme : bccCodeTheme ( {
28- home : '/' ,
2928 logoDark : 'logoWhite.png' ,
3029 logo : 'logo.png' ,
3130 repo : 'bcc-code' ,
Original file line number Diff line number Diff line change @@ -14,10 +14,6 @@ html.dark {
1414}
1515
1616// Overwrite default theme styles
17- .site-name {
18- display : none ;
19- }
20-
2117.sidebar-heading {
2218 text-transform : capitalize ;
2319}
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { ClientOnly , withBase } from ' @vuepress/client'
3+ import { computed , h } from ' vue'
4+ import type { FunctionalComponent } from ' vue'
5+ import { useDarkMode , useThemeLocaleData } from ' @vuepress/theme-default/lib/client/composables/index'
6+
7+ const themeLocale = useThemeLocaleData ()
8+ const isDarkMode = useDarkMode ()
9+
10+ const navbarBrandLogo = computed (() => {
11+ if (isDarkMode .value && themeLocale .value .logoDark !== undefined ) {
12+ return themeLocale .value .logoDark
13+ }
14+ return themeLocale .value .logo
15+ })
16+ const NavbarBrandLogo: FunctionalComponent = () => {
17+ if (! navbarBrandLogo .value ) return null
18+ const img = h (' img' , {
19+ class: ' logo' ,
20+ src: withBase (navbarBrandLogo .value ),
21+ alt: " BCC" ,
22+ })
23+ if (themeLocale .value .logoDark === undefined ) {
24+ return img
25+ }
26+ // wrap brand logo with <ClientOnly> to avoid ssr-mismatch
27+ // when using a different brand logo in dark mode
28+ return h (ClientOnly , () => img )
29+ }
30+ </script >
31+
32+ <template >
33+ <a href =" https://developer.bcc.no" >
34+ <NavbarBrandLogo />
35+ </a >
36+ </template >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const bccCodeTheme = (options: DefaultThemeOptions): Theme => {
1414
1515 alias : {
1616 '@theme/HomeFeatures.vue' : path . resolve ( __dirname , './components/HomeFeatures.vue' ) ,
17+ '@theme/NavbarBrand.vue' : path . resolve ( __dirname , './components/NavbarBrand.vue' ) ,
1718 } ,
1819 }
1920} ;
You can’t perform that action at this time.
0 commit comments