diff --git a/astro.config.mjs b/astro.config.mjs index 85afb7a..ac6fe54 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,12 +2,10 @@ import { defineConfig } from 'astro/config'; import cloudflare from "@astrojs/cloudflare"; import tailwind from "@astrojs/tailwind"; -import sitemap from "./scripts/sitemap.gen" - // https://astro.build/config export default defineConfig({ output: "server", adapter: cloudflare(), - integrations: [tailwind(), sitemap()], + integrations: [tailwind()], site: "https://s0u7a.net" }); diff --git a/scripts/sitemap.gen.ts b/scripts/sitemap.gen.ts deleted file mode 100644 index 88b36c8..0000000 --- a/scripts/sitemap.gen.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { AstroIntegration } from "astro"; -import { SitemapStream } from "sitemap"; -import { createWriteStream } from "fs"; -import { fileURLToPath } from "url"; - -const sitemap = (): AstroIntegration => { - return { - name: "shinobiworks/sitemap", - hooks: { - "astro:build:done": async ({ dir, pages }) => { - const hostname = "https://s0u7a.net/"; - const sms = new SitemapStream({ - hostname, - }); - const excludeSlugs = ["404", "sitepolicy", "privacypolicy"]; - const destinationDir = fileURLToPath(dir); - const outputFileName = "sitemap.xml"; - - pages.forEach(({ pathname }) => { - const slug = pathname.slice(0, -1); - if (!excludeSlugs.includes(slug)) { - sms.write(hostname + pathname); - } - }); - sms.end(); - sms.pipe(createWriteStream(destinationDir + outputFileName)); - - console.log(`%s${outputFileName} is generated!\n`, "\x1b[32m"); - }, - }, - }; -}; - -export default sitemap; \ No newline at end of file