update
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
import { Feed } from 'feed'
|
||||
import { Feed } from "feed";
|
||||
|
||||
const basePath = 'https://nurriyad.com'
|
||||
const basePath = "https://nurriyad.com";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
setHeader(event, 'content-type', 'text/xml')
|
||||
const docs = await queryCollection(event, 'content').all()
|
||||
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',
|
||||
language: "en",
|
||||
favicon: `${basePath}/favicon.ico`,
|
||||
copyright: 'MIT',
|
||||
copyright: "MIT",
|
||||
author: {
|
||||
name: 'Al Asad Nur Riyad',
|
||||
email: 'asadnurriyad@gmail.com',
|
||||
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 || '',
|
||||
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()
|
||||
})
|
||||
return feed.rss2();
|
||||
});
|
||||
|
||||
30
server/routes/sys-info.get.ts
Normal file
30
server/routes/sys-info.get.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { version as nuxtVersion } from "nuxt/package.json";
|
||||
import pkg from "~~/package.json";
|
||||
|
||||
export default defineEventHandler(async () => {
|
||||
let platform = { name: "Local", icon: "heroicons:computer-desktop" };
|
||||
|
||||
if (process.env.VERCEL) {
|
||||
platform = { name: "Vercel", icon: "simple-icons:vercel" };
|
||||
} else if (process.env.NETLIFY) {
|
||||
platform = { name: "Netlify", icon: "simple-icons:netlify" };
|
||||
} else if (process.env.CF_PAGES) {
|
||||
platform = { name: "Cloudflare", icon: "simple-icons:cloudflare" };
|
||||
} else if (process.env.GITHUB_ACTIONS) {
|
||||
platform = { name: "GitHub Actions", icon: "simple-icons:githubactions" };
|
||||
} else if (process.env.EDGEONE) {
|
||||
platform = { name: "Tencent EdgeOne", icon: "simple-icons:tencentcloud" };
|
||||
}
|
||||
|
||||
return {
|
||||
platform,
|
||||
versions: {
|
||||
vue: pkg.devDependencies.vue,
|
||||
nuxt: nuxtVersion,
|
||||
content: pkg.devDependencies["@nuxt/content"],
|
||||
node: process.version,
|
||||
os: process.platform,
|
||||
arch: process.arch,
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user