sunpy / ablog

ABlog for blogging with Sphinx
https://ablog.readthedocs.io/
Other
181 stars 54 forks source link

Enable configuring a canonical link for individual posts #257

Closed hendrikmakait closed 1 year ago

hendrikmakait commented 1 year ago

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).