From 045b3333e38b17b956dda3a077525bad55242720 Mon Sep 17 00:00:00 2001 From: Ian Roberts Date: Mon, 1 May 2023 20:49:52 -0600 Subject: [PATCH 1/2] feat(next-sitemap robots.txt, sitemap.xml): Adds auto generated sitemap & robots files DN-59 DN-59 --- next-sitemap.config.js | 5 +++++ package.json | 2 ++ public/robots.txt | 9 +++++++++ public/sitemap-0.xml | 15 +++++++++++++++ public/sitemap.xml | 4 ++++ yarn.lock | 18 ++++++++++++++++++ 6 files changed, 53 insertions(+) create mode 100644 next-sitemap.config.js create mode 100644 public/robots.txt create mode 100644 public/sitemap-0.xml create mode 100644 public/sitemap.xml diff --git a/next-sitemap.config.js b/next-sitemap.config.js new file mode 100644 index 0000000..4fba7df --- /dev/null +++ b/next-sitemap.config.js @@ -0,0 +1,5 @@ +/** @type {import('next-sitemap').IConfig} */ +module.exports = { + siteUrl: process.env.HOSTNAME || "https://designaroni.com", + generateRobotsTxt: true, +}; diff --git a/package.json b/package.json index 5ef5d28..8dd91a5 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..b447d35 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,9 @@ +# * +User-agent: * +Allow: / + +# Host +Host: localhost + +# Sitemaps +Sitemap: localhost/sitemap.xml diff --git a/public/sitemap-0.xml b/public/sitemap-0.xml new file mode 100644 index 0000000..77ab3e9 --- /dev/null +++ b/public/sitemap-0.xml @@ -0,0 +1,15 @@ + + +localhost2023-05-02T02:43:09.357Zdaily0.7 +localhost/about2023-05-02T02:43:09.357Zdaily0.7 +localhost/work2023-05-02T02:43:09.357Zdaily0.7 +localhost/category/hiking2023-05-02T02:43:09.357Zdaily0.7 +localhost/category/camping2023-05-02T02:43:09.357Zdaily0.7 +localhost/category/toyota-tacoma2023-05-02T02:43:09.357Zdaily0.7 +localhost/trips2023-05-02T02:43:09.357Zdaily0.7 +localhost/journal2023-05-02T02:43:09.357Zdaily0.7 +localhost/builds2023-05-02T02:43:09.357Zdaily0.7 +localhost/trips/hiking-zion-national-park2023-05-02T02:43:09.357Zdaily0.7 +localhost/author/ian-roberts/posts2023-05-02T02:43:09.357Zdaily0.7 +localhost/trips/posts2023-05-02T02:43:09.357Zdaily0.7 + \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..b626b01 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,4 @@ + + +localhost/sitemap-0.xml + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 93c0f3e..1dc4416 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" @@ -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" From 3808e9372424a8711c762d3ea374aa34e0b60d58 Mon Sep 17 00:00:00 2001 From: Ian Roberts Date: Mon, 1 May 2023 20:56:10 -0600 Subject: [PATCH 2/2] fix(public): removes autogenerated fileswq --- public/robots.txt | 9 --------- public/sitemap-0.xml | 15 --------------- public/sitemap.xml | 4 ---- 3 files changed, 28 deletions(-) delete mode 100644 public/robots.txt delete mode 100644 public/sitemap-0.xml delete mode 100644 public/sitemap.xml diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100644 index b447d35..0000000 --- a/public/robots.txt +++ /dev/null @@ -1,9 +0,0 @@ -# * -User-agent: * -Allow: / - -# Host -Host: localhost - -# Sitemaps -Sitemap: localhost/sitemap.xml diff --git a/public/sitemap-0.xml b/public/sitemap-0.xml deleted file mode 100644 index 77ab3e9..0000000 --- a/public/sitemap-0.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -localhost2023-05-02T02:43:09.357Zdaily0.7 -localhost/about2023-05-02T02:43:09.357Zdaily0.7 -localhost/work2023-05-02T02:43:09.357Zdaily0.7 -localhost/category/hiking2023-05-02T02:43:09.357Zdaily0.7 -localhost/category/camping2023-05-02T02:43:09.357Zdaily0.7 -localhost/category/toyota-tacoma2023-05-02T02:43:09.357Zdaily0.7 -localhost/trips2023-05-02T02:43:09.357Zdaily0.7 -localhost/journal2023-05-02T02:43:09.357Zdaily0.7 -localhost/builds2023-05-02T02:43:09.357Zdaily0.7 -localhost/trips/hiking-zion-national-park2023-05-02T02:43:09.357Zdaily0.7 -localhost/author/ian-roberts/posts2023-05-02T02:43:09.357Zdaily0.7 -localhost/trips/posts2023-05-02T02:43:09.357Zdaily0.7 - \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml deleted file mode 100644 index b626b01..0000000 --- a/public/sitemap.xml +++ /dev/null @@ -1,4 +0,0 @@ - - -localhost/sitemap-0.xml - \ No newline at end of file