per page metadata
Answered
Bombay posted this in #help-forum
BombayOP
how do i create per page title and description for seo using generateMetadata
Answered by Arboreal ant
11 Replies
Arboreal ant
What are you stuck with?
Answer
Arboreal ant
If you have static pages, export a const metadata with the title and description for that page, if it's dynamic can just export that generateMetadata function which is async and can do anything your server components can do (i.e. do a db lookup to get product title, description, etc)
i wanted to ask one more thing
will nextjs load both .env and
.env.production
.env.production
Arboreal ant
Yeah, the load order and other useful stuff is here: https://nextjs.org/docs/app/building-your-application/configuring/environment-variables#environment-variable-load-order
The docs are really good tbf, worth a quick google or just clicking through to see cool stuff you didn't know about.
BombayOP
thanks again
yeah
Arboreal ant
Anytime 🙂 Please mark as solved when you're happy ❤️