Skip to content

Commit

Permalink
exclude from sitemap (#371)
Browse files Browse the repository at this point in the history
* adjusted PDF_LINKS and some other urls to exclude from sitemap

* added pdf and adjusted kiosk sitemap exclusion

* exclude .gitkeep

* skip cypress job

* Revert "skip cypress job"

This reverts commit 77d8a8d.

---------

Co-authored-by: Nataliya Dyak <dyaknatal0@gmail.com>
  • Loading branch information
Andrea-Prague and nataliadiak authored Oct 31, 2023
1 parent 3bc41ac commit a6f8021
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ const SITE_URLS = {
};

/** @type {Array<string>} */
const PDF_LINKS = ['*/dictionary/pdf/*', '*/kids/stories/pdf/*', '*/alphabet/pdf/*'];
const PDF_LINKS = [
'/dictionary/pdf/*',
'/uk/dictionary/pdf/*',
'/kids/pdf/*',
'/uk/kids/pdf/*',
'/kids/stories/pdf/*',
'/uk/kids/stories/pdf/*',
'/alphabet/pdf/*',
'/uk/alphabet/pdf/*',
];

/** @type {Object<string,Array<string>>}} */
const EXCLUSIONS = {
cs: [...PDF_LINKS],
sk: ['/wiki*', '/uk/wiki*', ...PDF_LINKS],
pl: ['/wiki*', '/uk/wiki*', ...PDF_LINKS],
cs: ['/exercise/re*', '/uk/exercise/re*', '/kiosk*', '/uk/kiosk*', ...PDF_LINKS],
sk: ['/wiki*', '/uk/wiki*', '/exercise/re*', '/uk/exercise/re*', '/kiosk*', '/uk/kiosk*', ...PDF_LINKS],
pl: ['/wiki*', '/uk/wiki*', '/exercise/re*', '/uk/exercise/re*', '/kiosk*', '/uk/kiosk*', ...PDF_LINKS],
};

/** @type {import('next-sitemap').IConfig} */
Expand All @@ -44,7 +53,9 @@ module.exports = {

// add pdf files to sitemap
pdfFiles.forEach(async (file) => {
result.push(await config.transform(config, `${SITE_URLS[countryVariant]}/pdf/${encodeURIComponent(file)}`));
if (file !== '.gitkeep') {
result.push(await config.transform(config, `${SITE_URLS[countryVariant]}/pdf/${encodeURIComponent(file)}`));
}
});

return result;
Expand Down

0 comments on commit a6f8021

Please sign in to comment.