Closed vdjurdjevic closed 1 year ago
Hi @vdjurdjevic!
maybe can be added an absolute
param in alternateRefs
to avoid concatenation between href
and loc
to help in this use cases
Hey, tnx for fast reply!
I think that would be great solution :)
Hello,
I am trying to implement custom entry generation with
generateEntries
function on sitemap handle, but I am not able to generate what I want because loc value is appended to alternate href. Here is the problem:https://github.com/fedeya/remix-sitemap/blob/eeafd0add07ea138eda91fe21e0909dd98c5be05/src/utils/xml.ts#L161
According to this: [https://developers.google.com/search/docs/specialty/international/localized-versions#sitemap](Google's sitemap guide), I should have all localized versions as locs, and also all localized versions as alternate hrefs for every loc (makes no sense to me, but that's how Google want's it).
So, what I am trying to return as entries is this:
{ loc: '/', alternateRefs: [ { href: '/', hreflang: 'sr' }, { href: '/en', hreflang: 'en' }, ] }, { loc: '/en', alternateRefs: [ { href: '/', hreflang: 'sr' }, { href: '/en', hreflang: 'en' }, ] }
But generated sitemap is not valid, because I get
/en/en
for alternate href for second entry.