Skip to content

Commit d9c65ea

Browse files
committed
Fix website script to generate sitemap.xml
1 parent 9310427 commit d9c65ea

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

website/scripts/sitemap.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
34
import { findNestedFiles } from './utils/index';
45

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

78
// Find all route index files
89
const filePaths = findNestedFiles(
9-
[path.join('src', 'routes')],
10+
[
11+
path.join(
12+
path.dirname(fileURLToPath(import.meta.url)),
13+
'..',
14+
'src',
15+
'routes'
16+
),
17+
],
1018
(fileName) => fileName === 'index.tsx' || fileName === 'index.mdx'
1119
);
1220

21+
console.log('dirname', path.dirname(fileURLToPath(import.meta.url)));
22+
console.log('filePaths', filePaths);
23+
1324
// Create URL paths and sort them
1425
let urlSet = filePaths
1526
// Transform file paths to URL paths

0 commit comments

Comments
 (0)