Prettier config
This commit is contained in:
+20
-20
@@ -1,23 +1,23 @@
|
||||
import rss from "@astrojs/rss";
|
||||
import { getCollection } from "astro:content";
|
||||
import sanitizeHtml from "sanitize-html";
|
||||
import MarkdownIt from "markdown-it";
|
||||
const parser = new MarkdownIt({ html: true });
|
||||
import rss from '@astrojs/rss'
|
||||
import { getCollection } from 'astro:content'
|
||||
import sanitizeHtml from 'sanitize-html'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
const parser = new MarkdownIt({ html: true })
|
||||
|
||||
export async function get(context) {
|
||||
const blog = await getCollection("blog");
|
||||
console.log(blog);
|
||||
return rss({
|
||||
title: "ghall.blog",
|
||||
description:
|
||||
"My personal blog about life, gaming, tech, and whatever else I feel like writing about.",
|
||||
site: "https://ghall.blog",
|
||||
items: blog
|
||||
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
||||
.map((post) => ({
|
||||
link: `/posts/${post.slug}/`,
|
||||
content: sanitizeHtml(parser.render(post.body)),
|
||||
...post.data,
|
||||
})),
|
||||
});
|
||||
const blog = await getCollection('blog')
|
||||
console.log(blog)
|
||||
return rss({
|
||||
title: 'ghall.blog',
|
||||
description:
|
||||
'My personal blog about life, gaming, tech, and whatever else I feel like writing about.',
|
||||
site: 'https://ghall.blog',
|
||||
items: blog
|
||||
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
||||
.map((post) => ({
|
||||
link: `/posts/${post.slug}/`,
|
||||
content: sanitizeHtml(parser.render(post.body)),
|
||||
...post.data,
|
||||
})),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user