Skip to content

Commit

Permalink
docs: update sitemap.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn committed Jan 2, 2025
1 parent 75d37c5 commit ea5d445
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/routes/sitemap.xml/+server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import { toc } from '$content/examples/toc.js';
import { toc as docsToc } from '$content/docs/toc.js';
import { toc as exampleToc } from '$content/examples/toc.js';
import { toc as componentToc } from '$content/components/toc.js';
import type { RequestHandler } from '@sveltejs/kit';

export const GET: RequestHandler = async ({ request }) => {
const urls: string[] = [];
const origin = new URL(request.url).origin;

for (const section of toc) {
for (const section of exampleToc) {
for (const [path] of Object.entries(section.items)) {
urls.push(origin + path);
}
}
for (const section of componentToc) {
for (const [path] of Object.entries(section.items)) {
urls.push(origin + path);
}
}
for (const section of docsToc) {
for (const [path] of Object.entries(section.items)) {
urls.push(origin + path);
}
Expand Down

0 comments on commit ea5d445

Please sign in to comment.