Skip to content

Commit

Permalink
Add auto sitemap generation (#168)
Browse files Browse the repository at this point in the history
This commit adds a sitemap.xml to improve SEO for our project. By
using Next.js, we leverage the next-sitemap package
(https://www.npmjs.com/package/next-sitemap) to automatically generate
the sitemap during the build process.

Additionally, a robots.txt file has also been automatically created to
guide search engine crawlers.
  • Loading branch information
devleejb authored Sep 6, 2024
1 parent da10d22 commit d23e019
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ tags
.ionide

# End of https://www.toptal.com/developers/gitignore/api/vim,visualstudiocode

# Autogenerated files
sitemap.xml
robots.txt
6 changes: 6 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.NEXT_PUBLIC_SITE_URL,
generateRobotsTxt: true,
generateIndexSitemap: false,
};
106 changes: 74 additions & 32 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next build && next export",
"build": "next build && next-sitemap",
"export": "next build && next-sitemap && next export",
"start": "next start",
"lint": "next lint",
"fetch:ui": "./scripts/fetch-ui.sh",
Expand All @@ -25,6 +25,7 @@
"next-image-export-optimizer": "^1.0.1",
"next-mdx-remote": "^4.1.0",
"next-remote-watch": "^2.0.0",
"next-sitemap": "^4.2.3",
"prism-react-renderer": "^1.3.5",
"prismjs": "^1.29.0",
"react": "18.2.0",
Expand Down

0 comments on commit d23e019

Please sign in to comment.