Next.js 头部部分在下一个js上更新,在源代码中不可见
我正在为我的网站使用Next js,并在每个页面上添加了SEO的标题部分 这是我所有博客页面的代码。我已经导入了withRouter,以便我可以在头部使用routerNext.js 头部部分在下一个js上更新,在源代码中不可见,next.js,server-side-rendering,Next.js,Server Side Rendering,我正在为我的网站使用Next js,并在每个页面上添加了SEO的标题部分 这是我所有博客页面的代码。我已经导入了withRouter,以便我可以在头部使用router const head = () => { <Head> <title>Mental health blogs | {APP_NAME}</title> <meta name="description"
const head = () => {
<Head>
<title>Mental health blogs | {APP_NAME}</title>
<meta
name="description"
content="Mental Health blogs and tutorials on how to live mental-illness free"
/>
<link rel="canonical" href={`${DOMAIN}${router.pathname}`} />
<meta
property="og:title"
content={`Latest mental health blogs | ${APP_NAME}`}
/>
<meta
property="og:description"
content="Mental Health blogs and tutorials on how to live mental-illness free"
/>
<meta property="og:type" content="website" />
<meta property="og:url" content={`${DOMAIN}${router.pathname}`} />
<meta property="og:site_name" content={`${APP_NAME}`} />
<meta property="og:image" content={`${APP_NAME}`} />
<meta property="og:image:secure_url" content={`${APP_NAME}`} />
<meta property="og:image:type" content={`${APP_NAME}`} />
<meta property="fb:app_id" content={`${FB_APP_ID}`} />
</Head>;
};
const head=()=>{
心理健康博客|{APP_NAME}
;
};
我的所有博客页面都是服务器端呈现的。当我查看本页的源代码时,我看不到我的meta-title、meta-desc等。我不知道这里出了什么问题。提前谢谢