Commit 62c0f0d
fix(layout): build the page title in frontmatter to stop body-leak
The <title> element was assembled inline inside the head:
<title>{title}{lang === 'ja' ? '|' : ' | '}Vivliostyle Documentation</title>
Astro's parser was treating the trailing literal string `Vivliostyle
Documentation` and the close `</title>` separately from the JSX
expressions, which caused the static build to:
1. close <title> right after the ternary (so the title became
e.g. `活用ガイド|` with no "Vivliostyle Documentation"),
2. emit `Vivliostyle Documentation` as raw text after </head>,
3. fall back to dumping the rest of the layout's head content as
raw text into the body — including the literal source text
`isJa && ( )` from the next conditional block.
For web pages the leaked text was hidden by layout CSS so it went
unnoticed, but Vivliostyle CLI rendered it as a visible orphan
string on a blank cover page in every product's PDF / EPUB
(reported on vivliostyle-cookbook-ja.pdf, but cli/themes/vfm/
viewer/reference/cookbook all share the issue).
Compute fullTitle in the frontmatter as a plain template string and
substitute it with a single `{fullTitle}` interpolation. This keeps
the entire title atomic from the parser's standpoint and the rest of
<head> stays in <head>.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 30da0ec commit 62c0f0d
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
0 commit comments