garmeeh / next-seo

Next SEO is a plug in that makes managing your SEO easier in Next.js projects.
MIT License
7.56k stars 390 forks source link

Canonical links removing explicit trailing slash #1461

Open guilherssousa opened 4 months ago

guilherssousa commented 4 months ago

Describe the bug A clear and concise description of what the bug is.

I'm expecting my code to generate the rel=canonical tag with the link ending with a trailing slash, and, although it has been added explicitly on the canonical prop string, it still gets removed.

Reproduction For issues to be triaged in a timely manner please provide a Codesandbox/Github of the issue in it's simplest reproduction.

      <NextSEO
        title={/* redacted */}
        description={/* redacted */}
        canonical={`https://redacted.com/${slug}/`}
        />

returns <link rel="canonical" href="https://redacted.com/slug">

Expected behavior A clear and concise description of what you expected to happen.

I expect it to return the canonical href as https://redacted.com/slug/

Additional context Add any other context about the problem here.

Running on Next SEO 6.5.0 and Next 14.1.4