docsy icon indicating copy to clipboard operation
docsy copied to clipboard

Added Support for Canonical page link in <head>

Open iArchitSharma opened this issue 1 year ago • 4 comments

This PR fixes #2010 #1537

this code generates a canonical link tag for a webpage based on the value of the canonical_url parameter in the content file's front matter. If the parameter is not defined, it falls back to the permalink of the page, ensuring that search engines understand the preferred URL for the page.

iArchitSharma avatar Jun 03 '24 19:06 iArchitSharma

Hi, thanks for the PR! I think this functionality should go directly into layouts/partials/head.html, or into a separate partial that's included in head.html. The head-end hook is not a good place for it, because that's a placeholder file and many projects override it with their own code.

fekete-robert avatar Jun 04 '24 19:06 fekete-robert

Hi @iArchitSharma - it looks like you copied the file that I put together for the OTel.io site. Is that the case? If so, then that file is a partial experimental design (I still have work to do on it), and it isn't suitable, in it's current form, for inclusion in Docsy yet.

chalin avatar Jun 04 '24 21:06 chalin

@fekete-robert, thanks for the info. I'll move this functionality to head directly then.

iArchitSharma avatar Jun 05 '24 05:06 iArchitSharma

Yes, @chalin, I copied this from the OTel.io site. Although when I tested it, it seemed to work as intended. What improvements are needed here? I would love to help

iArchitSharma avatar Jun 05 '24 05:06 iArchitSharma