From 14ee13db34614dabebd56ba40a35bfaa710c35c5 Mon Sep 17 00:00:00 2001 From: Igor Sinyak Date: Mon, 9 Oct 2023 12:40:22 +0300 Subject: [PATCH] remove duplicated articles from sitemap --- scully/plugins/algolia.ts | 2 +- scully/plugins/sitemap/sitemap.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scully/plugins/algolia.ts b/scully/plugins/algolia.ts index c9e48c45..3d438f17 100644 --- a/scully/plugins/algolia.ts +++ b/scully/plugins/algolia.ts @@ -71,7 +71,7 @@ const updateAlgoliaIndex = async (dom, options): Promise => { return dom; } try { - if (options.data.title !== 'metadata') { + if (options.data.title !== 'metadata' && options.data.published && !options.data.redirect) { const { window } = dom; const { document } = window; const mainTitle = document.querySelector('h1')?.innerHTML || ''; diff --git a/scully/plugins/sitemap/sitemap.ts b/scully/plugins/sitemap/sitemap.ts index 9b4f85ff..a048219f 100644 --- a/scully/plugins/sitemap/sitemap.ts +++ b/scully/plugins/sitemap/sitemap.ts @@ -138,9 +138,9 @@ export const sitemapPlugin = async (routes: Array): Promise routes.forEach((route: HandledRoute) => { if ( - config.ignoredRoutes && - (config.ignoredRoutes.includes(route.route) || - config.ignoredRoutesPattern.some((regExp) => regExp.test(route.route))) + route.data.redirect || + config.ignoredRoutes.includes(route.route) || + config.ignoredRoutesPattern.some((regExp) => regExp.test(route.route)) ) { return; }