How do I pass hostname to Metadata title?
Answered
Tenterfield Terrier posted this in #help-forum
Tenterfield TerrierOP
I need to pass the hostname to Metadata title, which exists outside of the default export function. It must be a SSR page inside the App router.
const host = headers().get("host");
The function above gets what I want but it only works inside the default export function, and <Head><title></title></Head> no longer works for me.
Thanks ðŸ™
const host = headers().get("host");
The function above gets what I want but it only works inside the default export function, and <Head><title></title></Head> no longer works for me.
Thanks ðŸ™
7 Replies
Tenterfield TerrierOP
@Ray It worked! Thank you!
@Tenterfield Terrier <@743561772069421169> It worked! Thank you!
please mark solution
Answer
@Ray have you tried with `generateMetadata`?
Tenterfield TerrierOP
SOLUTION! Thanks Ray!
Tenterfield TerrierOP
(Please let me know if that is what you mean, I am a newbie)
right click the answer > application > mark solution
