Skip to content

Commit

Permalink
fix: update sitemap and update config
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Jun 10, 2023
1 parent de58c16 commit aec5ede
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 39 deletions.
43 changes: 17 additions & 26 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 15 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/rss/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>The David Dias | Front-End Developer, podcaster &amp; content creator</title>
<link>https://thedaviddias.dev</link>
<description>Hey, I'm David Dias! Front-End Developer based in Toronto/Canada. I love talking about code, technology, expatriation and life.</description>
<lastBuildDate>Sat, 10 Jun 2023 19:57:10 GMT</lastBuildDate>
<lastBuildDate>Sat, 10 Jun 2023 20:04:29 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>en</language>
Expand Down
2 changes: 1 addition & 1 deletion public/rss/fr/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>The David Dias | Développeur Front-End, podcasteur &amp; créateur de contenu</title>
<link>https://thedaviddias.dev</link>
<description>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.</description>
<lastBuildDate>Sat, 10 Jun 2023 19:57:10 GMT</lastBuildDate>
<lastBuildDate>Sat, 10 Jun 2023 20:04:29 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>fr</language>
Expand Down

2 comments on commit aec5ede

@vercel
Copy link

@vercel vercel bot commented on aec5ede Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for thedaviddiasdev ready!

✅ Preview
https://thedaviddiasdev-pq896usbe-thedaviddias1.vercel.app

Built with commit aec5ede.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.