with-apollo issues; dynamic content not rendering in Head in page source #12292
-
Dynamic contents are not rendering in Head in view page source, all meta tags are empty. That defeats the purpose on SEO in SSR please, help. repo: https://github.com/Segun98/Blog-Nextjs/blob/master/client/pages/post/%5Bid%5D.jsx Page source screenshot Code. Content are from a Graphql query in a dyynamic page [id].js |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You are fetching the post at runtime so the data is only available after you visit the page. Instead, you can fetch the post at build time with |
Beta Was this translation helpful? Give feedback.
You are fetching the post at runtime so the data is only available after you visit the page. Instead, you can fetch the post at build time with
getStaticProps
: https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation