Skip to content

Commit

Permalink
update index (3->5) & change rss author name
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDTR committed Feb 10, 2025
1 parent c6763f6 commit 72df077
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ pnpm-debug.log*
.obsidian/

# until i finish
yap-kitchen.md
ics-schedule-generator.md
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ allPosts.sort(
</div>
<hr class="custom-hr" />
<p>
Here are the three latest articles I've published. You can find the
Here are the five latest articles I've published. You can find the
entire list of my writing <a href="/blog" style="font-size: 1em;"
>on the blog page</a
>.
</p>
<ul class="blog-list">
{
allPosts.slice(0, 3).map((post) => (
allPosts.slice(0, 5).map((post) => (
<a href={post.url} class="blog-post-link">
<li class="blog-post-item">
{post.frontmatter.bestof && (
Expand Down
16 changes: 12 additions & 4 deletions src/pages/rss.xml.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import rss, { pagesGlobToRssItems } from '@astrojs/rss';

export async function GET(context) {
const originalItems = await pagesGlobToRssItems(
import.meta.glob('./blog/*.{md,mdx}')
);

const itemsWithAuthor = originalItems.map((item) => ({
...item,
author: 'Andrew Moses',
}));

return rss({
title: 'Andrew Moses',
description: 'The personal website & blog of Andrew Moses, a Computer Science student at the University of Wisconsin-Madison.',
description:
'The personal website & blog of Andrew Moses, a Computer Science student at the University of Wisconsin-Madison.',
site: context.site,
items: await pagesGlobToRssItems(
import.meta.glob('./blog/*.{md,mdx}'),
),
items: itemsWithAuthor,
stylesheet: '/rss/styles.xsl',
});
}

0 comments on commit 72df077

Please sign in to comment.