Skip to content

Commit

Permalink
🔍️ 添加sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
neila-a committed Apr 20, 2024
1 parent 459958b commit 875f334
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/core/src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {
MetadataRoute
} from "next";
import pack from "../../package.json";
import pages from "./pages.json";
export default function sitemap(): MetadataRoute.Sitemap {
let url = new URL(pack.homepage);
try {
url = new URL(process.env.VERKFI_URL)
} catch {
console.error(`URL build failed. Using ${url} from homepage in package.json.`);
}
return pages.map(page => ({
url: new URL(url + page).toString()
}));
}

0 comments on commit 875f334

Please sign in to comment.