I am not able to set title and others meta tags on a page created with dynamic routes. Title and metas are set correctly when the page is loaded in the browser, but they are not set in the raw HTML code I fetch using wget.
I have tried using both <Head>
and <NextSeo>
with same results.
I have also tried both getStaticProps() / getStaticPaths()
and getServerSideProps()
approaches.
Here is a simplified snippet of my code.
const PostPage = ( { post } ) => {
let txt = post.text || post.brief_descr;
return (
<Layout>
<NextSeo
title={post.title}
description={post.brief_descr}
/>
<h1>Hello World</h1>
</Layout>
);
};
export async function getServerSideProps ( { res, query } ) {
const p = query.params[ 0 ];
const data = await act_post_get( id, slug )();
return {
props: { post: data }
};
}