getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Suggestion: location url -> change domain based on language #104

Open aleclerc7 opened 2 years ago

aleclerc7 commented 2 years ago

Hello,

I do not know if this is proper for a sitemap, but I would like to suggest adding an option in the plugin to allow domain name change based on language.

Option 1: Based on the language code, force domain/subdomain name

Based on the page language code.

Option 2: Based on "location" URL, do a find-replace

If a location URL begins with X, then change it to Y.

Change location https://domain-fr.com/en/ to https://domain-en.com/ Change location https://domain-fr.com/pt/ to https://domain-pt.com/ Change location https://domain-en.com/fr/ to https://domain-fr.com/ Change location https://domain-en.com/pt/ to https://domain-pt.com/ Change location https://domain-pt.com/fr/ to https://domain-fr.com/ Change location https://domain-pt.com/en/ to https://domain-en.com/ ...

So for example, a location that would have https://domain-fr.com/en/page1 would be changed to https://domain-en.com/page1.

But any of these two options would be nice to have a very precise location URL for those who have a multilingual site with multiple domains or subdomains.

Kind regards.