From e65a061e9dd4a37de1c0df1d2bb5d19f98ed3671 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 17 Sep 2023 22:11:10 +0000 Subject: [PATCH] docs: Show multi params in README examples --- README.md | 25 +++++++++++++++++-------- package.json | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 89d78e2..49d88f3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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'; @@ -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 diff --git a/package.json b/package.json index cb0d003..7d4bc6d 100644 --- a/package.json +++ b/package.json @@ -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",