website: fix windows path issue. #161

This commit is contained in:
jaywcjlove
2022-11-21 23:43:42 +08:00
parent 8399eafe6e
commit e0e7636ba4
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ export async function createHTML(files = [], num = 0) {
const { html, data } = create(mdstr.toString(), options);
if (!options.isHome) {
const searchData = await fs.readJSON(SEARCH_DATA_CACHE);
data.path = path.relative(OUTOUT, outputHTMLPath);
data.path = path.relative(OUTOUT, outputHTMLPath).replace(/[\\/]/g, '/');
searchData[options.filename] = data;
searchData.name = options.filename;
await fs.writeJSON(SEARCH_DATA_CACHE, searchData);