This commit is contained in:
2026-01-01 17:49:08 +08:00
parent 2b4eeb6b17
commit 151324e6a6
3 changed files with 20 additions and 60 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@
node_modules node_modules
# System files # System files
*.log *.log
.env

View File

@@ -28,23 +28,7 @@ export default defineNuxtConfig({
build: { build: {
sourcemap: false, sourcemap: false,
chunkSizeWarningLimit: 1000, 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: { app: {
@@ -69,18 +53,30 @@ export default defineNuxtConfig({
layoutTransition: { name: "layout", mode: "out-in" }, layoutTransition: { name: "layout", mode: "out-in" },
}, },
sitemap: { // robots: { groups: [{ userAgent: ["GPTBot", "ChatGPT-User"], disallow: ["/"] }] },
sources: ["/api/__sitemap__/urls"],
},
robots: { groups: [{ userAgent: ["GPTBot", "ChatGPT-User"], disallow: ["/"] }] },
site: { site: {
url: siteConfig.siteMeta.url, // url: siteConfig.siteMeta.url,
name: siteConfig.siteMeta.title, url: "https://blog.rhen.cloud",
// name: siteConfig.siteMeta.title,
name: "RhenCloud's Blog",
description: siteConfig.siteMeta.description, description: siteConfig.siteMeta.description,
author: siteConfig.siteMeta.author, author: siteConfig.siteMeta.author,
}, },
sitemap: {
sitemapsPathPrefix: "/",
zeroRuntime: true,
sitemaps: {
posts: {
include: ["/blog/**"],
},
},
autoLastmod: true,
// sources: ["/api/sitemap"],
// sources: ["/api/__sitemap__/urls"],
},
typescript: { typescript: {
strict: true, strict: true,
}, },
@@ -94,7 +90,7 @@ export default defineNuxtConfig({
nitro: { nitro: {
prerender: { prerender: {
crawlLinks: true, crawlLinks: true,
routes: ["/", "/rss.xml", "/sitemap.xml"], routes: ["/", "/rss.xml", "/sitemap_index.xml"],
ignore: ["/404"], ignore: ["/404"],
}, },
minify: true, minify: true,

View File

@@ -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();
});