feat: inject French sitemap URLs into English sitemap via source endpoint
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// fetches the deployed French sitemap and injects its URLs into the English sitemap
|
||||
export default defineEventHandler(async () => {
|
||||
try {
|
||||
const xml = await $fetch<string>('https://docu.djeex.fr/fr/sitemap.xml')
|
||||
const urls = [...xml.matchAll(/<loc>([^<]+)<\/loc>/g)].map(m => m[1])
|
||||
return urls.map(loc => ({ loc }))
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user