Files
365devnet/src/pages/rss.xml.js
2022-08-17 22:37:38 -04:00

21 lines
531 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import rss from "@astrojs/rss";
import { SITE } from "~/config";
import { getAllPosts } from "~/utils/getAllPosts";
const posts = await getAllPosts();
export const get = () =>
rss({
title: `${SITE.name}s Blog`,
description:
"A ready to start template to make your website using Astro and Tailwind CSS.",
site: import.meta.env.SITE,
items: posts.map((post) => ({
link: `blog/${post.slug}`,
title: post.title,
description: post.description,
pubDate: post.pubDate,
})),
});