Closed viceroyliu closed 1 year ago
我在文档中找到了这个,还是希望能够再增加一下,如果不是#一级标题。 可以选择文件名作为标题来展示,谢谢
This issue is marked as stale
because it has not had recent activity. Issues marked with stale
will be closed if they have no activity within 7 days.
Override Page.title
in extendsPage
hook
Clear and concise description of the problem
因为我每次在文件中还要手动添加title,我的文章太多这太繁琐了。
Suggested solution
if(pathInferred !== null){ if(pathInferred.substring(1) === filePathRelative.replace(/.md$/, ".html")) { let newTitle = filePathRelative.replace(/.md$/,'').split('/').pop(); routeMeta.title = newTitle; } }
我尝试在@vuepress/core/dist/index.js 第110行,增加代码判断,把routeMeta改为文件名,但并没有起到作用。
Alternative
No response
Additional context
No response