Skip to content

Commit e73c44f

Browse files
committed
fix lint issue by
1 parent 295d076 commit e73c44f

1 file changed

Lines changed: 26 additions & 19 deletions

File tree

src/pages/rss.xml.ts

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
import path from "~/lib/path";
21
import rss from "@astrojs/rss";
3-
import { getCollection, type ContentEntryMap } from "astro:content";
4-
import { SITE_TITLE, SITE_DESCRIPTION, gardenBasePath } from "../config";
5-
import { collections } from "~/content/config";
2+
import type { RSSFeedItem } from "@astrojs/rss";
3+
import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
4+
//import path from "~/lib/path";
5+
//import { getCollection, type ContentEntryMap } from "astro:content";
6+
//import { collections } from "~/content/config";
67

78
export const GET = async () => {
8-
let posts = [];
9-
for (const k in collections) {
10-
posts.push(...(await getCollection(k as keyof ContentEntryMap)));
11-
}
12-
const items = posts.filter((p) => !p.data.draft).map((p) => {
13-
return {
14-
link: p.collection === "garden"
15-
? path.join(gardenBasePath, p.slug)
16-
: path.join("blog", p.slug),
17-
title: p.data.title,
18-
pubDate: p.data.pubDate,
19-
description: p.data.description,
20-
categories: p.data.tags,
21-
};
22-
});
9+
// let posts = [];
10+
// for (const k in collections) {
11+
// let c = await getCollection(k as keyof ContentEntryMap, ({ data }) => {
12+
// console.log(data);
13+
// return !data.draft;
14+
// });
15+
// // console.log(c);
16+
// posts.push(...(await getCollection(k as keyof ContentEntryMap)));
17+
// }
18+
// const items = posts.filter((p) => !p.data.draft).map((p) => {
19+
// return {
20+
// link: p.collection === "garden"
21+
// ? path.join(gardenBasePath, p.slug)
22+
// : path.join("blog", p.slug),
23+
// title: p.data.title,
24+
// pubDate: p.data.pubDate,
25+
// description: p.data.description,
26+
// categories: p.data.tags,
27+
// };
28+
// });
29+
let items: RSSFeedItem[] = [];
2330
return rss({
2431
title: SITE_TITLE,
2532
description: SITE_DESCRIPTION,

0 commit comments

Comments
 (0)