Skip to content

Commit

Permalink
fix rss error and add rss link in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
hyundonmoon committed Oct 1, 2024
1 parent 5887114 commit cf1ecbc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,12 @@ const today = new Date();
<span>LinkedIn</span>
</NavLink>
</li>

<li>
<NavLink class="flex items-center gap-2" href="/rss.xml">
<ArrowIcon class="w-2 h-2" />
<span>RSS</span>
</NavLink>
</li>
</ul>
</footer>
6 changes: 5 additions & 1 deletion src/pages/rss.xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export async function GET(context) {
const sortedNotes = notes.sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
);
const rssLangTag = {
English: "en",
Korean: "ko",
};

return rss({
title: "Hyun Don's Blog",
Expand All @@ -17,7 +21,7 @@ export async function GET(context) {
pubDate: data.pubDate,
description: data.summary,
link: `/notes/${slug}`,
customData: data.language,
customData: `<language>${rssLangTag[data.language] || "en"}</language>`,
})),
});
}

0 comments on commit cf1ecbc

Please sign in to comment.