diff --git a/.gitignore b/.gitignore index ef7205a..54cc203 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ node_modules # System files *.log +.env diff --git a/nuxt.config.ts b/nuxt.config.ts index 8341a27..4ebfee1 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -28,23 +28,7 @@ export default defineNuxtConfig({ build: { sourcemap: false, chunkSizeWarningLimit: 1000, - // rollupOptions: { - // output: { - // manualChunks: { - // vendor: ["vue", "vue-router", "@nuxt/content"], - // ui: ["@nuxt/ui", "@nuxt/icon"], - // utils: ["fuse.js"], - // }, - // }, - // }, }, - // ssr: { - // external: ["node:url", "node:fs/promises"], - // noExternal: ["@nuxt/ui", "@nuxt/kit"], - // }, - // optimizeDeps: { - // exclude: ["@nuxt/kit", "@nuxt/ui"], - // }, }, app: { @@ -69,18 +53,30 @@ export default defineNuxtConfig({ layoutTransition: { name: "layout", mode: "out-in" }, }, - sitemap: { - sources: ["/api/__sitemap__/urls"], - }, - robots: { groups: [{ userAgent: ["GPTBot", "ChatGPT-User"], disallow: ["/"] }] }, + // robots: { groups: [{ userAgent: ["GPTBot", "ChatGPT-User"], disallow: ["/"] }] }, site: { - url: siteConfig.siteMeta.url, - name: siteConfig.siteMeta.title, + // url: siteConfig.siteMeta.url, + url: "https://blog.rhen.cloud", + // name: siteConfig.siteMeta.title, + name: "RhenCloud's Blog", description: siteConfig.siteMeta.description, author: siteConfig.siteMeta.author, }, + sitemap: { + sitemapsPathPrefix: "/", + zeroRuntime: true, + sitemaps: { + posts: { + include: ["/blog/**"], + }, + }, + autoLastmod: true, + // sources: ["/api/sitemap"], + // sources: ["/api/__sitemap__/urls"], + }, + typescript: { strict: true, }, @@ -94,7 +90,7 @@ export default defineNuxtConfig({ nitro: { prerender: { crawlLinks: true, - routes: ["/", "/rss.xml", "/sitemap.xml"], + routes: ["/", "/rss.xml", "/sitemap_index.xml"], ignore: ["/404"], }, minify: true, diff --git a/server/routes/rss.xml.ts b/server/routes/rss.xml.ts deleted file mode 100644 index bb9c1a8..0000000 --- a/server/routes/rss.xml.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Feed } from "feed"; - -const basePath = "https://nurriyad.com"; - -export default defineEventHandler(async (event) => { - setHeader(event, "content-type", "text/xml"); - const docs = await queryCollection(event, "content").all(); - const feed = new Feed({ - title: "Riyad's personal blog site", - description: "Riyad's personal blog site", - id: basePath, - link: basePath, - language: "en", - favicon: `${basePath}/favicon.ico`, - copyright: "MIT", - author: { - name: "Al Asad Nur Riyad", - email: "asadnurriyad@gmail.com", - link: basePath, - }, - }); - - // Add the feed items - docs.forEach((doc) => { - // console.log(doc) - feed.addItem({ - title: doc.title || "", - id: basePath + doc.path, - link: basePath + doc.path, - description: doc.description, - content: doc.description, - date: new Date(doc.meta?.date as string), - }); - }); - - return feed.rss2(); -});