Skip to content

Using dynamic urls using _sitemap-urls.ts with i18n? #167

Closed Answered by notflip
notflip asked this question in Q&A
Discussion options

You must be logged in to vote

Answering my own question here, in case anyone needs it. The following is working now, I'm using the returned language code from the CMS to determine which sitemap the content goes in.

results.push({
    loc: `/cases/${caseItemTranslation.slug}`,
    lastmod: new Date(caseItem.date_updated).toISOString(),
    _sitemap: caseItemTranslation.languages_code,
})

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@notflip
Comment options

Comment options

You must be logged in to vote
2 replies
@harlan-zw
Comment options

@notflip
Comment options

Answer selected by notflip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants