Skip to content

Commit 0eb64fa

Browse files
committed
chore: Update package.json with postbuild script for next-sitemap
1 parent 2632445 commit 0eb64fa

File tree

6 files changed

+80
-22
lines changed

6 files changed

+80
-22
lines changed

next-sitemap.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: 'https://www.bentogridgenerator.com',
4+
generateRobotsTxt: true,
5+
sitemapSize: 7000,
6+
exclude: ['/admin/*'],
7+
robotsTxtOptions: {
8+
policies: [
9+
{ userAgent: '*', allow: '/' },
10+
{ userAgent: '*', disallow: '/admin' },
11+
],
12+
additionalSitemaps: [
13+
'https://www.bentogridgenerator.com/sitemap.xml',
14+
],
15+
},
16+
};

package-lock.json

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

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"postbuild": "next-sitemap"
1011
},
1112
"dependencies": {
1213
"@fontsource-variable/m-plus-2": "^5.0.17",
1314
"next": "14.2.3",
15+
"next-sitemap": "^4.2.3",
1416
"react": "^18",
1517
"react-dom": "^18",
1618
"react-helmet": "^6.1.0",

public/robots.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# *
2+
User-agent: *
3+
Allow: /
4+
5+
# *
6+
User-agent: *
7+
Disallow: /admin
8+
9+
# Host
10+
Host: https://www.bentogridgenerator.com
11+
12+
# Sitemaps
13+
Sitemap: https://www.bentogridgenerator.com/sitemap.xml

public/sitemap-0.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+
<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://www.bentogridgenerator.com</loc><lastmod>2024-06-12T09:29:45.493Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
</urlset>

public/sitemap.xml

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

0 commit comments

Comments
 (0)