Skip to content

Commit

Permalink
Add Sitemap
Browse files Browse the repository at this point in the history
Signed-off-by: C0D3 M4513R <[email protected]>
  • Loading branch information
C0D3-M4513R committed Oct 8, 2024
1 parent 65cd0d3 commit d1a55f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"vite": "^5.1.5",
"vite-plugin-pages": "^0.32.1",
"vite-ssg": "^0.23.8",
"vite-ssg-sitemap": "^0.8.1",
"vue-router": "^4.3.0"
}
}
10 changes: 9 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fileURLToPath, URL } from 'node:url'
import {defineConfig, splitVendorChunkPlugin} from 'vite'
import vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
import generateSitemap from 'vite-ssg-sitemap'
import {faqIds} from './src/data/faq/questions.js'

// https://vitejs.dev/config/
Expand Down Expand Up @@ -49,6 +50,13 @@ export default defineConfig({
if (route.path === '/:catchAll(.*)') return []
return route.path === '/faq/:id?' ? faqIds.map(id => `/faq/${id}`) : route.path
});
}
},
/* generate a sitemap */
onFinished() {
generateSitemap({
hostname: "https://kettingpowered.org/",
exclude: ["/404"],
})
},
}
})

0 comments on commit d1a55f9

Please sign in to comment.