Skip to content

Commit

Permalink
docs: Show multi params in README examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongitmail committed Sep 17, 2023
1 parent 18cb932 commit e65a061
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,19 @@ export const GET = async () => {
`.*\\[page=integer\\].*` // e.g. routes containing `[page=integer]`–e.g. `/blog/2`
],
paramValues: {
'/blog/[slug]': blogSlugs, // e.g. ['hello-world', 'another-post']
'/blog/tag/[tag]': blogTags // e.g. ['red', 'green', 'blue']
'/blog/[slug]': blogSlugs, // e.g. ['hello-world', 'another-post']
'/blog/tag/[tag]': blogTags, // e.g. ['red', 'green', 'blue']
'/campsites/[country]/[state]': [
['usa', 'new-york'],
['usa', 'california'],
['canada', 'toronto']
]
},
headers: {
'custom-header': 'foo' // case insensitive; defaults to XML content type & 1h CDN cache
},
additionalPaths: [ // e.g. to a file in your static dir
'/foo.pdf'
additionalPaths: [
'/foo.pdf' // e.g. to a file in your static dir
],
changefreq: 'daily', // defaults to false b/c ignored by modern search engines
priority: 0.7 // defaults to false b/c ignored by modern search engines
Expand All @@ -149,7 +154,7 @@ export const GET = async () => {

TypeScript:

```ts
```js
// /src/routes/sitemap.xml/+server.ts
import * as sitemap from 'sk-sitemap';
import * as blog from '$lib/data/blog';
Expand All @@ -172,14 +177,18 @@ export const GET: RequestHandler = async () => {
],
paramValues: {
'/blog/[slug]': blogSlugs, // e.g. ['hello-world', 'another-post']
'/blog/tag/[tag]': blogTags // e.g. ['red', 'green', 'blue']
'/blog/tag/[tag]': blogTags, // e.g. ['red', 'green', 'blue']
'/campsites/[country]/[state]': [
['usa', 'new-york'],
['usa', 'california'],
['canada', 'toronto']
]
},
headers: {
'custom-header': 'foo' // case insensitive; defaults to XML content type & 1h CDN cache
},
additionalPaths: [
// e.g. to a file in your static dir
'/foo.pdf'
'/foo.pdf' // e.g. to a file in your static dir
],
changefreq: 'daily', // defaults to false b/c ignored by modern search engines
priority: 0.7 // defaults to false b/c ignored by modern search engines
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sk-sitemap",
"version": "0.10.0",
"version": "0.10.1",
"description": "SvelteKit sitemap that just works and makes it impossible to forget to add paths.",
"repository": {
"type": "git",
Expand Down

0 comments on commit e65a061

Please sign in to comment.