payload
payload copied to clipboard
plugin-seo: Support for multiple languages for hreflang tags / rel=alternate
I have 3+ languages and each document has a different slug and a different "base path", so for example
- /oman-trips/best-of-oman (EN)
- /oman-reisen/berge-strand-und-wuestenluxus (DE)
- /voyage-a-oman/le-meilleur-oman (FR)
Now I'd like to generate the hreflang tags like this
<link rel="alternate" href="mynicepage.com/oman-trips/best-of-oman" hreflang="en">
<link rel="alternate" href="mynicepage.com/de/oman-reisen/berge-strand-und-wuestenluxus" hreflang="de">
<link rel="alternate" href="mynicepage.com/fr/voyage a-oman/le-meilleur-oman" hreflang="fr>
I see the following problems
- The CMS does not know the "base path", because in my case the collection item doesn't know it's base path (oman-trips, vs oman-reisen, vs voyage-a-oman) except I would reference each item manually to a page - which feels a bit repetitive, but solvable.
- Not sure how to query the data in an efficient way
I would be happy to do a PR because I need this feature and remove a bunch of custom code from my site
(I'm using 1.X with webpack and mongo, but I'm looking forward to migrate to postgres ASAP)