Skip to content

Commit 2cbc582

Browse files
committed
feat(client): add sitemap generation to next app
1 parent 30d0151 commit 2cbc582

File tree

6 files changed

+56
-2
lines changed

6 files changed

+56
-2
lines changed

client/next-sitemap.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: 'https://rxresu.me',
4+
changefreq: 'monthly',
5+
generateRobotsTxt: true,
6+
};

client/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"name": "@reactive-resume/client",
33
"scripts": {
44
"dev": "react-env --prefix PUBLIC -- next dev",
5-
"build": "next build",
5+
"build": "next build && npm run sitemap",
66
"start": "react-env --prefix PUBLIC -- next start",
7-
"lint": "next lint --fix"
7+
"lint": "next lint --fix",
8+
"sitemap": "next-sitemap --config next-sitemap.config.js"
89
},
910
"dependencies": {
1011
"@beam-australia/react-env": "^3.1.1",
@@ -67,6 +68,7 @@
6768
"autoprefixer": "^10.4.2",
6869
"eslint": "^8.10.0",
6970
"eslint-config-next": "12.1.0",
71+
"next-sitemap": "^2.5.7",
7072
"postcss": "^8.4.8",
7173
"prettier": "^2.5.1",
7274
"sass": "^1.49.9",

client/public/robots.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# *
2+
User-agent: *
3+
Allow: /
4+
5+
# Host
6+
Host: https://rxresu.me
7+
8+
# Sitemaps
9+
Sitemap: https://rxresu.me/sitemap.xml

client/public/sitemap-0.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
3+
<url><loc>https://rxresu.me</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
4+
<url><loc>https://rxresu.me/dashboard</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
5+
<url><loc>https://rxresu.me/meta/privacy</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
6+
<url><loc>https://rxresu.me/meta/service</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
7+
<url><loc>https://rxresu.me/de/dashboard</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
8+
<url><loc>https://rxresu.me/kn/dashboard</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
9+
<url><loc>https://rxresu.me/ta/dashboard</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
10+
<url><loc>https://rxresu.me/hi/dashboard</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
11+
<url><loc>https://rxresu.me/de</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
12+
<url><loc>https://rxresu.me/kn</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
13+
<url><loc>https://rxresu.me/ta</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
14+
<url><loc>https://rxresu.me/hi</loc><changefreq>monthly</changefreq><priority>0.7</priority><lastmod>2022-03-12T10:44:13.581Z</lastmod></url>
15+
</urlset>

client/public/sitemap.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<sitemap><loc>https://rxresu.me/sitemap-0.xml</loc></sitemap>
4+
</sitemapindex>

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)