Skip to content

Commit

Permalink
feat(next-sitemap robots.txt, sitemap.xml): Adds auto generated sitem…
Browse files Browse the repository at this point in the history
…ap & robots files

DN-59

DN-59
  • Loading branch information
Designaroni committed May 2, 2023
1 parent 2dd30f0 commit 045b333
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.HOSTNAME || "https://designaroni.com",
generateRobotsTxt: true,
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"local": "yarn dev",
"dev": "next dev",
"build": "next build",
"postbuild": "next-sitemap",
"start": "next start",
"commit": "git-cz",
"lint": "yarn lint:ts; yarn lint:js; yarn lint:scss",
Expand Down Expand Up @@ -63,6 +64,7 @@
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^8.0.2",
"next-sitemap": "^4.0.9",
"prettier": "2.6.2",
"semantic-release": "^19.0.5",
"stylelint-config-css-modules": "^4.1.0",
Expand Down
9 changes: 9 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# *
User-agent: *
Allow: /

# Host
Host: localhost

# Sitemaps
Sitemap: localhost/sitemap.xml
15 changes: 15 additions & 0 deletions public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<url><loc>localhost</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/about</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/work</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/category/hiking</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/category/camping</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/category/toyota-tacoma</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/trips</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/journal</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/builds</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/trips/hiking-zion-national-park</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/author/ian-roberts/posts</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>localhost/trips/posts</loc><lastmod>2023-05-02T02:43:09.357Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
4 changes: 4 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>localhost/sitemap-0.xml</loc></sitemap>
</sitemapindex>
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@
dependencies:
chalk "^4.1.0"

"@corex/deepmerge@^4.0.37":
version "4.0.43"
resolved "https://registry.yarnpkg.com/@corex/deepmerge/-/deepmerge-4.0.43.tgz#9bd42559ebb41cc5a7fb7cfeea5f231c20977dca"
integrity sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==

"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
Expand Down Expand Up @@ -3965,6 +3970,11 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==

minimist@^1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==

minipass-collect@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617"
Expand Down Expand Up @@ -4098,6 +4108,14 @@ nerf-dart@^1.0.0:
resolved "https://registry.yarnpkg.com/nerf-dart/-/nerf-dart-1.0.0.tgz#e6dab7febf5ad816ea81cf5c629c5a0ebde72c1a"
integrity sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==

next-sitemap@^4.0.9:
version "4.0.9"
resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-4.0.9.tgz#534d2e96440e1579c7053f56cd4a1fe912b63ea5"
integrity sha512-8pbcEe4vrmgGEc3beVbrSqd8mTQ9lCsGxP+AOlArrGmeLkKD4TbSR41R2unQHHSTkBG8cQ/7gjKkdLBlzwtu6g==
dependencies:
"@corex/deepmerge" "^4.0.37"
minimist "^1.2.8"

next@^12.2.5:
version "12.3.1"
resolved "https://registry.npmjs.org/next/-/next-12.3.1.tgz#127b825ad2207faf869b33393ec8c75fe61e50f1"
Expand Down

0 comments on commit 045b333

Please sign in to comment.