vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.29k stars 926 forks source link

[Feature request] 我希望能够增加路由选项,以md中文文件名作为路由来设置 #1392

Closed viceroyliu closed 1 year ago

viceroyliu commented 1 year ago

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

viceroyliu commented 1 year ago
image

我在文档中找到了这个,还是希望能够再增加一下,如果不是#一级标题。 可以选择文件名作为标题来展示,谢谢

github-actions[bot] commented 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.

Mister-Hope commented 1 year ago

Override Page.title in extendsPage hook