mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-17 20:51:21 +08:00
website: fix windows path issue. #161
This commit is contained in:
@ -4,7 +4,7 @@ import { getSVGNode } from './getSVGNode.mjs';
|
||||
const ICONS_PATH = path.resolve(process.cwd(), 'scripts/assets');
|
||||
|
||||
export function darkMode({ homePath = '', isHome } = {}) {
|
||||
const relativePath = homePath.replace(/\/?index.html$/, isHome ? '' : '/');
|
||||
const relativePath = homePath.replace(/[\\/]?index.html$/, isHome ? '' : '/');
|
||||
const iconSunPath = path.resolve(ICONS_PATH, `sun.svg`);
|
||||
const iconMoonPath = path.resolve(ICONS_PATH, `moon.svg`);
|
||||
const sunNode = getSVGNode(iconSunPath);
|
||||
|
Reference in New Issue
Block a user