Skip to content

Commit

Permalink
Merge pull request #463 from G-Core/redirect-article-fix
Browse files Browse the repository at this point in the history
remove duplicated articles from sitemap
  • Loading branch information
IgorSinyak authored Oct 9, 2023
2 parents 8c058b3 + 14ee13d commit a881346
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scully/plugins/algolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const updateAlgoliaIndex = async (dom, options): Promise<JSDOM> => {
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 || '';
Expand Down
6 changes: 3 additions & 3 deletions scully/plugins/sitemap/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ export const sitemapPlugin = async (routes: Array<HandledRoute>): Promise<void>

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;
}
Expand Down

0 comments on commit a881346

Please sign in to comment.