From aec5edee102e1095faeb78591b1092708d39d779 Mon Sep 17 00:00:00 2001 From: David Dias Date: Sat, 10 Jun 2023 16:11:08 -0400 Subject: [PATCH] fix: update sitemap and update config --- next-sitemap.config.js | 43 +++++++++++++++++------------------------- package.json | 2 +- pnpm-lock.yaml | 25 ++++++++++++++---------- public/rss/feed.xml | 2 +- public/rss/fr/feed.xml | 2 +- 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/next-sitemap.config.js b/next-sitemap.config.js index 0b713fe..58aafb4 100644 --- a/next-sitemap.config.js +++ b/next-sitemap.config.js @@ -1,8 +1,7 @@ /** @type {import('next-sitemap').IConfig} */ -const commonOptions = { - changefreq: 'weekly', - priority: 0.4, +const commonOptions = (config) => ({ + lastmod: config.autoLastmod ? new Date().toISOString() : undefined, alternateRefs: [ { href: 'https://thedaviddias.dev', @@ -13,70 +12,62 @@ const commonOptions = { hreflang: 'fr', }, ], -} +}) const config = { siteUrl: 'https://thedaviddias.dev', generateRobotsTxt: true, exclude: ['/404', '/fr/404'], - additionalPaths: async () => { + additionalPaths: async (config) => { const result = [] result.push({ loc: '/', - ...commonOptions, + ...commonOptions(config), }) result.push({ loc: '/about', - ...commonOptions, + changefreq: 'weekly', + ...commonOptions(config), }) result.push({ loc: '/articles', - ...commonOptions, + ...commonOptions(config), }) result.push({ loc: '/notes', - ...commonOptions, + ...commonOptions(config), }) result.push({ loc: '/projects', - ...commonOptions, - }) - - result.push({ - loc: '/bookmarks', - ...commonOptions, + changefreq: 'weekly', + ...commonOptions(config), }) result.push({ loc: '/tags', - ...commonOptions, + changefreq: 'weekly', + ...commonOptions(config), }) result.push({ loc: '/dashboard', - ...commonOptions, + changefreq: 'weekly', + ...commonOptions(config), }) result.push({ loc: '/uses', - ...commonOptions, + changefreq: 'monthly', + ...commonOptions(config), }) return result }, - robotsTxtOptions: { - policies: [ - { - userAgent: '*', - allow: '/', - }, - ], - }, } module.exports = config diff --git a/package.json b/package.json index c8e7180..3361652 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "husky": "8.0.3", "lint-staged": "13.1.0", "next-bundle-analyzer": "0.6.7", - "next-sitemap": "3.1.49", + "next-sitemap": "4.1.3", "node-fetch": "^3.3.1", "pretty-ms": "^8.0.0", "react-goodreads-shelf": "^3.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c65da2c..42d5ac0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,7 +51,7 @@ specifiers: next-mdx-remote: ^4.1.0 next-plausible: ^3.7.2 next-seo: ^5.5.0 - next-sitemap: 3.1.49 + next-sitemap: 4.1.3 next-themes: 0.2.1 next-translate: ^1.5.0 node-fetch: ^3.3.1 @@ -139,7 +139,7 @@ devDependencies: husky: 8.0.3 lint-staged: 13.1.0 next-bundle-analyzer: 0.6.7_next@13.4.4 - next-sitemap: 3.1.49_4le57alqltvittyazakkkztd2a + next-sitemap: 4.1.3_4le57alqltvittyazakkkztd2a node-fetch: 3.3.1 pretty-ms: 8.0.0 react-goodreads-shelf: 3.1.3 @@ -1452,8 +1452,8 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 - /@corex/deepmerge/4.0.29: - resolution: {integrity: sha512-q/yVUnqckA8Do+EvAfpy7RLdumnBy9ZsducMUtZTvpdbJC7azEf1hGtnYYxm0QfphYxjwggv6XtH64prvS1W+A==} + /@corex/deepmerge/4.0.43: + resolution: {integrity: sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==} dev: true /@cspotcode/source-map-support/0.8.1: @@ -5806,6 +5806,10 @@ packages: /minimist/1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + /minimist/1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + /mkdirp-classic/0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} dev: true @@ -5911,17 +5915,18 @@ packages: react-dom: 18.2.0_react@18.2.0 dev: false - /next-sitemap/3.1.49_4le57alqltvittyazakkkztd2a: - resolution: {integrity: sha512-bxBq+MQdi580PKn/8ert4X0RL8Kp9scvyiq6TmIpkCQC3bd4DResTyxHY2AuCGKz83ut2udHwKMZu3ztj3aq3w==} + /next-sitemap/4.1.3_4le57alqltvittyazakkkztd2a: + resolution: {integrity: sha512-eCvbXMCqbD/rYx912y4FzGOqPCbWOIBL4UkgVY5R15eCXygKFKWzEVZGPNVBDu2KVpRCeG943NibOchfyQGDhQ==} engines: {node: '>=14.18'} hasBin: true peerDependencies: '@next/env': '*' next: '*' dependencies: - '@corex/deepmerge': 4.0.29 + '@corex/deepmerge': 4.0.43 '@next/env': 13.1.6 - minimist: 1.2.7 + fast-glob: 3.2.12 + minimist: 1.2.8 next: 13.4.4_pjwopsidmaokadturxaafygjp4 dev: true @@ -6440,7 +6445,7 @@ packages: detect-libc: 1.0.3 expand-template: 2.0.3 github-from-package: 0.0.0 - minimist: 1.2.7 + minimist: 1.2.8 mkdirp-classic: 0.5.3 napi-build-utils: 1.0.2 node-abi: 2.30.1 @@ -6552,7 +6557,7 @@ packages: dependencies: deep-extend: 0.6.0 ini: 1.3.8 - minimist: 1.2.7 + minimist: 1.2.8 strip-json-comments: 2.0.1 dev: true diff --git a/public/rss/feed.xml b/public/rss/feed.xml index f3218a6..f949e33 100644 --- a/public/rss/feed.xml +++ b/public/rss/feed.xml @@ -4,7 +4,7 @@ The David Dias | Front-End Developer, podcaster & content creator https://thedaviddias.dev Hey, I'm David Dias! Front-End Developer based in Toronto/Canada. I love talking about code, technology, expatriation and life. - Sat, 10 Jun 2023 19:57:10 GMT + Sat, 10 Jun 2023 20:04:29 GMT https://validator.w3.org/feed/docs/rss2.html https://github.com/jpmonette/feed en diff --git a/public/rss/fr/feed.xml b/public/rss/fr/feed.xml index 60844f9..29e4bdb 100644 --- a/public/rss/fr/feed.xml +++ b/public/rss/fr/feed.xml @@ -4,7 +4,7 @@ The David Dias | Développeur Front-End, podcasteur & créateur de contenu https://thedaviddias.dev Salut toi! Je m'appele David Dias. Je suis développeur Front-End, podcasteur, créateur de contenu numérique passioné pour résoudre les problèmes digitaux et humains! J'aime rencontrer de nouvelles personnes, bâtir des communautées et parler de tech, d'expatriation et de web. - Sat, 10 Jun 2023 19:57:10 GMT + Sat, 10 Jun 2023 20:04:29 GMT https://validator.w3.org/feed/docs/rss2.html https://github.com/jpmonette/feed fr