Open
Description
Describe the bug
When the title of a page is the result of variable interpolation, it shows correctly inside a h1
element, but the value of the variable does not end up inside the <title>
element of the rendered HTML page.
Let's say I have this inside example.md
of the starter template:
<script setup>
const title = "VitePress 💙 StackBlitz"
</script>
# {{ title }}
Then the title
element will contain {{ title }} | VitePress
Reproduction
https://stackblitz.com/edit/vite-pivzggyp?file=docs%2Fexample.md
Expected behavior
The title
element contains the value of the variable, e.g VitePress 💙 StackBlitz | VitePress
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vitepress: latest => 1.6.3
Additional context

Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.