I'm currently facing an issue with implementing dynamic URLs in my Next.js dynamic routes.
To generate metadata, I am utilizing a server-rendered page:
export const metadata: Metadata = {
title: `InterviewQA | ItsIndianGuy`,
description:
"Explore interview questions in various programming languages such as JavaScript, Python, C++ and more. Enhance your preparation with comprehensive language-specific content.",
alternates: {
canonical: "https://itsindianguy.in/interview-qa",
},
};
The specific dynamic page that requires SEO optimization is shown in the image below:
https://i.sstatic.net/oifof2A4.png
My challenge lies in implementing this for dynamic pages as opposed to static pages, where I can't use hooks to retrieve the pathname on server-rendered pages.
What steps should I take next to address this issue?