Apologies for the confusion. You're right, the previous example would insert a <template> tag into the <head>, which is not valid HTML. Unfortunately, based on the provided extracts, there isn't a direct way to modify the <head> from a child component using Astro.
However, you can work around this limitation by using a prop to pass the additional content to the Layout component. Here's an example:
In your Layout component, add a prop for the additional head content:
---
import '../styles/main.css';
import '../styles/tweaks.scss';
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Reel</title>
{Astro.props.headContent}
</head>
<body style="">
<slot />
</body>
</html>
Then, in your child component, pass the additional content as a prop:
<Layout headContent={`<title>BONGOS!</title>`}>
<!-- Other content -->
</Layout>
Keep in mind that this approach has limitations, and you'll need to ensure that the content you pass as a prop is valid HTML.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: