$ the-wire · showcase
VitePress eagerly resolves $frontmatter expressions
By RepoJournal · Filed · About Vue.js
VitePress now resolves $frontmatter expressions during markdown rendering, making titles available to tools like local search that never run Vue.
VitePress now resolves `$frontmatter` expressions like `{{ $frontmatter.title }}` during markdown rendering, so tools that never run Vue, such as local search, see the resolved value instead of the raw expression [1]. The follow-up hardens the eager frontmatter interpolation implementation with fixes for `v-pre` handling, where any HTML block merely containing the text `v-pre` previously turned the feature off for the rest of the page [2]. The new scanner correctly tracks real `v-pre` scopes in raw HTML, for blocks and inline tags alike [2]. Additionally, VitePress replaced the deprecated `lodash.template` with eta [3], which is purely a dependency swap with no behavior change. Both the feature and its hardening landed as commits authored with Claude Fable 5 [4][5], and one description notes it adds a test for each correctness gap found in the review [2].
Action items
- → Test local search and any non-Vue consumers of markdown after upgrading to the latest VitePress dev build vuejs/vitepress [plan]
- → Review the new eager frontmatter interpolation plugin for edge cases with $frontmatter expressions vuejs/vitepress [monitor]
References
- [1] feat: resolve `$frontmatter` expressions while rendering markdown ↗ vuejs/vitepress
- [2] fix: harden eager frontmatter interpolation ↗ vuejs/vitepress
- [3] chore: replace `lodash.template` with eta ↗ vuejs/vitepress
- [4] fix: harden eager frontmatter interpolation (#5413) ↗ vuejs/vitepress
- [5] feat: resolve `$frontmatter` expressions while rendering markdown (#5412) ↗ vuejs/vitepress