Skip to content

Commit 30fa407

Browse files
committed
fix: 修复文档路径非 docs 时的字数统计问题
1 parent a774c13 commit 30fa407

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function genConfig() {
6464
HideReadingTime,
6565
HideLastUpdated,
6666
HideAuthors,
67+
rootDir,
6768
} = themeConfig
6869
const additionalNav = [
6970
{
@@ -278,7 +279,7 @@ function genConfig() {
278279
transformPageData(pageData) {
279280
// 构建 Markdown 文件路径
280281
const markdownFile = `${pageData.relativePath}`
281-
const filePath = path.join(process.cwd(), 'docs', markdownFile)
282+
const filePath = path.join(process.cwd(), `${rootDir}`, markdownFile)
282283

283284
// 从文件系统读取文件内容
284285
const content = readMarkdownFileContent(filePath)

0 commit comments

Comments
 (0)