mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
ignore: docs: fix type errors in sitemap generation script
Some checks are pending
deploy / deploy (push) Waiting to run
Some checks are pending
deploy / deploy (push) Waiting to run
This commit is contained in:
parent
006f3bdeb6
commit
01705fd467
1 changed files with 9 additions and 7 deletions
|
|
@ -1,12 +1,14 @@
|
|||
#!/usr/bin/env bun
|
||||
import { readdir } from "fs/promises"
|
||||
import { join } from "path"
|
||||
import { config } from "../src/config.ts"
|
||||
import { readdir, writeFile } from "fs/promises"
|
||||
import { join, dirname } from "path"
|
||||
import { fileURLToPath } from "url"
|
||||
import { config } from "../src/config.js"
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const BASE_URL = config.baseUrl
|
||||
const PUBLIC_DIR = join(import.meta.dir, "../public")
|
||||
const ROUTES_DIR = join(import.meta.dir, "../src/routes")
|
||||
const DOCS_DIR = join(import.meta.dir, "../../../web/src/content/docs")
|
||||
const PUBLIC_DIR = join(__dirname, "../public")
|
||||
const ROUTES_DIR = join(__dirname, "../src/routes")
|
||||
const DOCS_DIR = join(__dirname, "../../../web/src/content/docs")
|
||||
|
||||
interface SitemapEntry {
|
||||
url: string
|
||||
|
|
@ -93,7 +95,7 @@ async function main() {
|
|||
const xml = generateSitemapXML(allRoutes)
|
||||
|
||||
const outputPath = join(PUBLIC_DIR, "sitemap.xml")
|
||||
await Bun.write(outputPath, xml)
|
||||
await writeFile(outputPath, xml, "utf-8")
|
||||
|
||||
console.log(`✓ Sitemap generated at ${outputPath}`)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue