From cdee6dc105acb7caa2004ceaebc88ff74c0bcca0 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Sat, 7 Dec 2024 05:44:37 +0800 Subject: [PATCH] fix(theme): unformatted system `sep` cause auto frontmatter error (#370) --- theme/src/node/autoFrontmatter/readFile.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/theme/src/node/autoFrontmatter/readFile.ts b/theme/src/node/autoFrontmatter/readFile.ts index 615d873f..bc347154 100644 --- a/theme/src/node/autoFrontmatter/readFile.ts +++ b/theme/src/node/autoFrontmatter/readFile.ts @@ -3,6 +3,7 @@ import type { AutoFrontmatterMarkdownFile } from '../../shared/index.js' import type { Generate } from './generator.js' import fg from 'fast-glob' import { fs, path } from 'vuepress/utils' +import { normalizePath } from '../utils/index.js' export async function readMarkdownList( app: App, @@ -33,7 +34,7 @@ export async function readMarkdown( const stats = await fs.promises.stat(filepath) return { filepath, - relativePath, + relativePath: normalizePath(relativePath), content: await fs.promises.readFile(filepath, 'utf-8'), createTime: getFileCreateTime(stats), stats,