website: update dark theme issue.

This commit is contained in:
jaywcjlove
2022-11-20 03:37:25 +08:00
parent 98eae38934
commit 79dcdc7379
4 changed files with 24 additions and 16 deletions

View File

@ -6,7 +6,7 @@ import { darkMode } from '../utils/darkMode.mjs';
const ICONS_PATH = path.resolve(process.cwd(), 'scripts/assets/quickreference.svg');
const ICONS_SEARCH_PATH = path.resolve(process.cwd(), 'scripts/assets/search.svg');
export function header({ homePath, githubURL = '' }) {
export function header({ homePath, githubURL = '', isHome } = {}) {
const svgNode = getSVGNode(ICONS_PATH);
const svgSearchNode = getSVGNode(ICONS_SEARCH_PATH);
const data = [
@ -50,7 +50,7 @@ export function header({ homePath, githubURL = '' }) {
label: '编辑',
children: [editor],
},
...darkMode(),
...darkMode({ homePath, isHome }),
{
menu: true,
href: 'https://github.com/jaywcjlove/reference',