Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Check languages->count rather than multilang for when to add hreflang's to sitemap #41

Open
shoesforindustry opened this issue Apr 8, 2020 · 0 comments

Comments

@shoesforindustry
Copy link

We often have the situation where we have a language file (site/languages/en.php) for string variables, even when we are only using a single language. It likely that the site will become multilingual at a later date... but we would not want the extra hreflang stuff in the sitemap for just one lang at the present time.

In xmlsitemap.php on line 278 you test for languages with:
if ( kirby()->multilang() == true )
This will add hreflang to the sitemap if we have just one language file.

Maybe use languages count instead?
if ( kirby()->languages()->count() >1 )
This will add NOT add hreflang to the sitemap if we have just one language file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant