LukasJoswiak / etch

A simple, responsive writing theme for Hugo.
https://lukasjoswiak.github.io/etch/
MIT License
295 stars 166 forks source link

Add canonical link #45

Closed Antonrr closed 2 years ago

Antonrr commented 2 years ago

Hello! This pull request adds canonical link tag.

LukasJoswiak commented 2 years ago

Hi, thanks for the PR! Based on my admittedly limited understanding of the canonical link tag, it is used to represent the best version of a page and is especially useful when different pages have similar content, but one of the pages is the "canonical" version. Is there any benefit to setting this tag to the current URL for each page? It seems like the search engine would assume this by default.

Antonrr commented 2 years ago

Hello! Your understanding is perfectly right. Though search engines indeed can assume canonical URLs by themselves, it is recommended to include the tag. In this case it will lead to one concrete URL on all possible mirrors (for example, www subdomain?). I added it to my page to fix search engine warnings.

LukasJoswiak commented 2 years ago

Thanks for the explanation, I'll go ahead and merge this.