-
So, this doesn't appear in the documentation and I'm not aware if it's possible or not, but for SEO purposes, I will have need of adding various meta tags to the I can see that in render.tsx, the template takes TemplateOptions, which includes this, but so far I have not yet figured out how to add/inject my own headComponents into this. I'm probably just missing something obvious, but for the life of me, I'm struggling to figure out how to modify this from my app. Any ideas? Or do I need to add a ticket to allow for this? --EDIT-- |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yes, I agree this should be documented. Anyway, here is a snippet to add header in a route: import { Head } from "$fresh/src/runtime/head.ts";
import { Fragment, h } from "preact";
export default function TestHead() {
return (
<>
<Head>
<meta charSet="utf-8" />
<meta
name="description"
content="Author: A.N. Author, Illustrator: P. Picture, Category: Books, Price: £9.24, Length: 784 pages"
/>
<meta
name="google-site-verification"
content="+nxGUDJ4QpAZ5l9Bsjdi102tLVC21AIh5d1Nl23908vVuFHs34="
/>
<title>Example Books - high-quality used books for children</title>
<meta name="robots" content="noindex,nofollow" />
<link rel="stylesheet" href="/index.css" />
</Head>
<div>
Content
</div>
</>
);
} |
Beta Was this translation helpful? Give feedback.
-
Another option is to use the |
Beta Was this translation helpful? Give feedback.
Yes, I agree this should be documented.
Anyway, here is a snippet to add header in a route: