From e92980a2c5e15d40802869446a4c997a35ee2349 Mon Sep 17 00:00:00 2001 From: Emmanuel Gautier Date: Wed, 25 Oct 2023 19:57:22 +0200 Subject: [PATCH 1/2] fix(@galactiks/astro-integration): exclude non canonical urls from sitemap --- packages/adapters/astro/src/preset.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/adapters/astro/src/preset.mts b/packages/adapters/astro/src/preset.mts index b632eec6..eec09b13 100644 --- a/packages/adapters/astro/src/preset.mts +++ b/packages/adapters/astro/src/preset.mts @@ -23,7 +23,7 @@ export const integrationsPreset = (): AstroIntegration[] => [ serialize: async (item) => { const page = await getPageByURL(item.url); if (!page) { - return item; + return undefined; } return ({ From 34eafafa42fdb64029280639c3ff4b10736b617e Mon Sep 17 00:00:00 2001 From: Emmanuel Gautier Date: Wed, 25 Oct 2023 19:57:52 +0200 Subject: [PATCH 2/2] fix(@galactiks/astro-integration): get only language from locale inLanguage string --- packages/adapters/astro/src/preset.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/adapters/astro/src/preset.mts b/packages/adapters/astro/src/preset.mts index eec09b13..2db8f797 100644 --- a/packages/adapters/astro/src/preset.mts +++ b/packages/adapters/astro/src/preset.mts @@ -32,7 +32,7 @@ export const integrationsPreset = (): AstroIntegration[] => [ news: page.type === 'Article' && { publication: { name: getConfig().webManifest.name, - language: getDefaultLanguage(), + language: (page.inLanguage && getDefaultLanguage())?.substring(0, 2).toLowerCase(), }, publication_date: isValid(page.datePublished) ? page.datePublished.toISOString() : undefined,