-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to disable inferred "Home" page title #249
Comments
Not in the browser tab, but in social previews adding this to the frontmatter in head:
- - meta
- name: twitter:title
content: My Site
- - meta
- name: og:title
- content: My Site |
Hm cool little hack, thanks. For the titles, something like titleTemplate of Vue Meta would be great. |
I suggest to have this behavior : if title is set, use it, else if, use default home title. const inferTitle = (frontmatter: any, content: string) => {
if (frontmatter.title) {
return deeplyParseHeader(frontmatter.title)
}
if (frontmatter.home) {
return 'Home'
}
const match = content.match(/^\s*#+\s+(.*)/m)
if (match) {
return deeplyParseHeader(match[1].trim())
}
return ''
} |
Related #263 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is it possible to disable the "Home" page title when using
home: true
? I trying to keep just the site title.Related code:
vitepress/src/node/markdownToVue.ts
Lines 129 to 141 in 74f5ada
The text was updated successfully, but these errors were encountered: