You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npx vitepress init generates a default .vitepress/config.mts based on user responses, which is helpful. One of these questions/responses is the title of the site. This is inserted into config.mts as the title: kv pair for the config object.
However, when title exists without titleTemplate, the html <title> is rendered with duplication.
For example, if the user answers My Site to the title question, the browser displays in the tab or bookmark the title of the site as "My Site | My Site". This is not only unattractive, but it's difficult to discover why this is happening.
### Additional context
_No response_
### Validations
- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).
- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.dev).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
The text was updated successfully, but these errors were encountered:
Describe the bug
npx vitepress init
generates a default.vitepress/config.mts
based on user responses, which is helpful. One of these questions/responses is the title of the site. This is inserted intoconfig.mts
as thetitle:
kv pair for the config object.However, when
title
exists withouttitleTemplate
, the html<title>
is rendered with duplication.For example, if the user answers
My Site
to the title question, the browser displays in the tab or bookmark the title of the site as "My Site | My Site". This is not only unattractive, but it's difficult to discover why this is happening.Reproduction
https://stackblitz.com/edit/vite-fmv5pr?file=docs%2F.vitepress%2Fconfig.ts
Open the resulting site @ webcontainer.io in a separate browser window to see the result.
Expected behavior
I expect no duplication. This could be accomplished by:
titleTemplate
is missing, thattitle
is not rendered as<title>{{ title }} | {{ title }}</title>
titleTemplate
in the init questionnaire; or simply including a default value that is different than what the user answered for titleSystem Info
The text was updated successfully, but these errors were encountered: