Skip to content

Commit

Permalink
fix: 修复文档路径非 docs 时的字数统计问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Oct 26, 2024
1 parent a774c13 commit 30fa407
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function genConfig() {
HideReadingTime,
HideLastUpdated,
HideAuthors,
rootDir,
} = themeConfig
const additionalNav = [
{
Expand Down Expand Up @@ -278,7 +279,7 @@ function genConfig() {
transformPageData(pageData) {
// 构建 Markdown 文件路径
const markdownFile = `${pageData.relativePath}`
const filePath = path.join(process.cwd(), 'docs', markdownFile)
const filePath = path.join(process.cwd(), `${rootDir}`, markdownFile)

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

0 comments on commit 30fa407

Please sign in to comment.