Skip to content

Commit

Permalink
fix xml?
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Sep 20, 2024
1 parent 91391f9 commit 37ac5a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/feed_fake.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
// FIXME: https://github.com/ddamato/astro-mdx-rss
export const partial = true;
import { getCollection } from 'astro:content';
const posts = await getCollection('blog');
const posts = (await getCollection('blog')).filter(
post => !(post.data.draft === true)
);
---
<?xml version="1.0" encoding="UTF-8"?>
<Fragment is:raw><?xml version="1.0" encoding="UTF-8"?></Fragment>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>ayats.org</title>
<description>Welcome to my personal blog.</description>
<Fragment set:html={ `<link>${ Astro.url.origin }</link>` }/>
</channel>
{ posts.map(async (post) => {
{ posts
.map(async (post) => {
const url = new URL(`blog/${post.slug}`, Astro.url.origin).toString();
const { Content } = await post.render();
return (
Expand Down

0 comments on commit 37ac5a4

Please sign in to comment.