Skip to content

Commit 4dd6f8d

Browse files
committed
fix: using sitemap generator
1 parent 7bc5880 commit 4dd6f8d

File tree

3 files changed

+167
-8
lines changed

3 files changed

+167
-8
lines changed

nuxt.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default {
3838
{ rel: "manifest", href: "/manifest.json" },
3939
{ rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" },
4040
{ rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
41+
{ rel: "sitemap", type: "application/xml", title: "Sitemap", href: "/sitemap.xml" },
4142
{ rel: "apple-touch-icon", sizes: "57x57", href: "/apple-touch-icon-57x57.png" },
4243
{ rel: "apple-touch-icon", sizes: "72x72", href: "/apple-touch-icon-72x72.png" },
4344
{ rel: "apple-touch-icon", sizes: "76x76", href: "/apple-touch-icon-76x76.png" },
@@ -76,6 +77,7 @@ export default {
7677
modules: [
7778
// https://go.nuxtjs.dev/pwa
7879
'@nuxtjs/pwa',
80+
'@nuxtjs/sitemap'
7981
],
8082

8183
// PWA module configuration: https://go.nuxtjs.dev/pwa
@@ -85,6 +87,10 @@ export default {
8587
}
8688
},
8789

90+
// sitemap autogeneration https://github.com/nuxt-community/sitemap-module
91+
sitemap: {
92+
hostname: BASE_URL
93+
},
8894
// Build Configuration: https://go.nuxtjs.dev/config-build
8995
build: {
9096
extractCSS: true

package-lock.json

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

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"dev": "nuxt",
7-
"build": "nuxt build",
8-
"start": "nuxt start",
9-
"generate": "nuxt generate",
6+
"clean": "rimraf ./dist",
7+
"dev": "npm run clean && nuxt",
8+
"build": "npm run clean && nuxt build",
9+
"start": "npm run clean && nuxt start",
10+
"generate": "npm run clean && nuxt generate",
1011
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
1112
"lint:style": "stylelint \"**/*.{vue,css}\" --ignore-path .gitignore",
1213
"prepare": "husky install",
@@ -22,6 +23,7 @@
2223
},
2324
"dependencies": {
2425
"@nuxtjs/pwa": "^3.3.5",
26+
"@nuxtjs/sitemap": "^2.4.0",
2527
"@tailwindcss/forms": "^0.3.4",
2628
"core-js": "^3.15.1",
2729
"diff": "^5.0.0",
@@ -51,7 +53,7 @@
5153
"jest": "^27.0.5",
5254
"lint-staged": "^10.5.4",
5355
"postcss": "^8.3.5",
54-
"prettier": "^2.3.2",
56+
"rimraf": "^3.0.2",
5557
"stylelint": "^13.13.1",
5658
"stylelint-config-prettier": "^8.0.2",
5759
"stylelint-config-standard": "^22.0.0",

0 commit comments

Comments
 (0)