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
The document title gets split in a way it shouldnt when using ternarys
The code
---interfaceProps { title?:string;}const { title } =Astro.props;---
<!doctypehtml>
<htmllang="en">
<head>
... other head ...
<metaname="generator"content={Astro.generator} />
<title>{title?`${title} - `:""}Doctor 9 Tutoring</title>
</head>
<bodyclass="dark">
...
</body>
</html>
Will produce a site where the document/page title is <title> - (title is the correct value as passed to the component), and first child of the body would be "Doctor 9 Tutoring", rather than being correctly wrapped within the <title> tag. I did also notice that the is not being returned, however the content of the body is returned when looking at the network tab.
It works fine however if i put {title} - Doctor 9 Tutoring in the <title> tag instead
What version of
@astrojs/compiler
are you using?2.10.3
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
The document title gets split in a way it shouldnt when using ternarys
The code
Will produce a site where the document/page title is
<title> -
(title is the correct value as passed to the component), and first child of the body would be "Doctor 9 Tutoring", rather than being correctly wrapped within the<title>
tag. I did also notice that the is not being returned, however the content of the body is returned when looking at the network tab.It works fine however if i put
{title} - Doctor 9 Tutoring
in the<title>
tag insteadLink to Minimal Reproducible Example
https://stackblitz.com/edit/github-jsi3lg?file=src%2Fpages%2Fwith-title.astro
The text was updated successfully, but these errors were encountered: