Skip to content

Commit

Permalink
Fix website script to generate sitemap.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller committed Feb 14, 2025
1 parent 9310427 commit d9c65ea
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion website/scripts/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { findNestedFiles } from './utils/index';

const ORIGIN = 'https://valibot.dev';

// Find all route index files
const filePaths = findNestedFiles(
[path.join('src', 'routes')],
[
path.join(
path.dirname(fileURLToPath(import.meta.url)),
'..',
'src',
'routes'
),
],
(fileName) => fileName === 'index.tsx' || fileName === 'index.mdx'
);

console.log('dirname', path.dirname(fileURLToPath(import.meta.url)));
console.log('filePaths', filePaths);

// Create URL paths and sort them
let urlSet = filePaths
// Transform file paths to URL paths
Expand Down

0 comments on commit d9c65ea

Please sign in to comment.