Skip to content

Commit

Permalink
docs: sitemap documentation
Browse files Browse the repository at this point in the history
"husky": "^8.0.2"
sitemap.xml.ts documentation updated
  • Loading branch information
BenjaminOddou committed Nov 8, 2022
1 parent 0c9f73e commit ea68e7e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
50 changes: 25 additions & 25 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-nuxt": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.1",
"husky": "^8.0.2",
"nuxt": "^3.0.0-rc.13",
"nuxt-schema-org": "^1.1.0-beta.5",
"prettier": "^2.7.1",
Expand Down
2 changes: 2 additions & 0 deletions server/routes/sitemap.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ export default defineEventHandler(() => {
lastmodDateOnly: false
})

// Alternatively create array of objects like so : const endpoints = [{url: '/', changefreq: 'weekly'}, {url: '/gallery', changefreq: 'monthly'}, ...]
const endpoints = ['/', '/gallery', '/about']
const changeFreq = 'weekly'
const Priority = 0.9
const date = new Date().toISOString()

// If using array of objects, reference them as like so : url: enpoint.url, changefreq: endpoint.changefreq
for (const endpoint of endpoints) {
sitemap.write({
url: endpoint,
Expand Down

0 comments on commit ea68e7e

Please sign in to comment.