slidev
slidev copied to clipboard
`titleTemplate` not working
Describe the bug
titleTemplate
is not using the title attribute or h1 of each page, where it's always using the very first title on the first cover page.
If not title defined in the first cover page, Slidev
is used to replace %s
To Reproduce Steps to reproduce the behavior:
- Go to
slides.md
- Add `titleTempalte: '%s - test' in FrontMatter
- Add a title or
h1
to the first page - Add second page and define a title or
h1
-
%s
is not replacing with the second page's title but keeping using the first page's.
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Chrome 120
- Slidev version: latest
I think this is the expected behavior in the current design. For most slides, the first slide's title is the global title, but the titles of other slides are often titles of sections, and some non-first slides may even have no title.
In the future, a section
option can be added to the per-slide frontmatter, which will update the page title.