Skip to content

canonical() does not return correct value, if routes -> canonical is set #4023

@AndeeZee

Description

@AndeeZee

If my page contains a specific entry for canonical route and the server url differs from that page, canonical returns a concatenated value, which breaks the sitemap and therefor other processes and plugins like seo-magic.

Example:

I have my page open with url:
https://my-url.tld

In my page.md, the following header is defined:

---

routes:
    canonical: https://www.my-url.tld
---

Because the prefixed www should be the canonical one.

In that case, the canonical() function returns a concatenated value of both:
https://my-url.tldhttps://www.my-url.tld

This will break further processes, relying on a correct sitemap.

Any help/fix appreciated! Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions