Skip to content

Enable configuring a canonical link for individual posts #257

@hendrikmakait

Description

@hendrikmakait

Describe the feature

When re-publishing content written for a company blog on my personal blog, I need to add a canonical link to the original version published on the company page to avoid duplicate content issues in search engines.

Sphinx adds canonical link relations to the <head> element by configuring html_baseurl. However, this value is configured once for the entire blog and relies on the URL scheme of the pages generated by Sphinx, so this approach is not flexible enough to link individual posts to arbitrary URLs.

Proposed solution

As a solution, we could add a canonical_link option to the post directive, which overwrites the default canonical link (pageurl).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions