omz13 / kirby3-xmlsitemap

kirby3 plugin to generate an xml-based sitemap
59 stars 10 forks source link

Use language code() instead of locale() for hreflang #19

Closed JimmyRittenborg closed 5 years ago

JimmyRittenborg commented 5 years ago

I had to change locale() to code() since our locale config should match up with our installed server languages to work correctly. It was outputting hreflang="en-us.utf-8" and hreflang="da-dk.utf-8" by using code() (which actually should match up with the accepted browser language anyway) I'm finally getting hreflang="en" and hreflang="da" 🎉

omz13 commented 5 years ago

The issue you are experiencing is because getHreflangFromLocale is not coping with the .utf-8 suffix of the locale. I thought I'd fixed this issue. Well, I had, in honehome, but somehow I forgot to backport the fix I did there to here. I'll push a fix.