This commit is contained in:
2026-01-01 21:59:28 +08:00
parent 2eba888094
commit 1d888e9af0
38 changed files with 449 additions and 2469 deletions

View File

@@ -1,5 +1,5 @@
export default defineEventHandler(async (event) => {
const docs = await queryCollection(event, "content").all();
const docs = await queryCollection(event, "content").where("published", "==", true).all();
const urls: Array<{ loc: string; lastmod: string }> = [];

View File

@@ -1,23 +1,21 @@
import { Feed } from "feed";
const basePath = "https://blog.rhen.cloud";
import siteConfig from "~/config";
export default defineEventHandler(async (event) => {
setHeader(event, "content-type", "text/xml");
const docs = await queryCollection(event, "content").all();
const feed = new Feed({
title: "RhenCloud's Blog",
description:
"Welcome To My Blog Site. Get Web Development, Javascript, Typescript, NodeJs, Vue, and Nuxt, Related Articles, Tips, Learning resources and more.",
id: basePath,
link: basePath,
language: "zh-CN",
favicon: `${basePath}/favicon.ico`,
title: siteConfig.siteMeta.title,
description: siteConfig.siteMeta.description,
id: siteConfig.siteMeta.url,
link: siteConfig.siteMeta.url,
language: siteConfig.siteMeta.lang,
favicon: `${siteConfig.siteMeta.url}/${siteConfig.siteMeta.favicon}`,
copyright: "MIT",
author: {
name: "RhenCloud",
email: "i@rhen.cloud",
link: basePath,
name: siteConfig.siteMeta.author,
email: siteConfig.siteMeta.email,
link: siteConfig.siteMeta.url,
},
});
@@ -26,8 +24,8 @@ export default defineEventHandler(async (event) => {
// console.log(doc)
feed.addItem({
title: doc.title || "",
id: basePath + doc.path,
link: basePath + doc.path,
id: siteConfig.siteMeta.url + "/" + doc.path,
link: siteConfig.siteMeta.url + "/" + doc.path,
description: doc.description,
content: doc.description,
date: new Date(doc.meta?.date as string),