jekyll / jekyll-seo-tag

A Jekyll plugin to add metadata tags for search engines and social networks to better index and display your site's content.
https://jekyll.github.io/jekyll-seo-tag
MIT License
1.66k stars 294 forks source link

Canonical URL comes out with two slashes if the site URL ends in a slash #500

Open hakanai opened 9 months ago

hakanai commented 9 months ago

My site URL was configured like so:

url: https://mysite.name/

Which is a pretty conventional to write it; it always feels wrong omitting the slash.

But then in the generated metadata, I get two slashes on the end:

<link rel="canonical" href="https://mysite.name//" />

And similarly for child pages:

<link rel="canonical" href="https://mysite.name//principles/" />

I know I can probably remove my slash to work around this, but it would be nice if URL joining would collapse the double slashes automatically.