Skip to content

Commit 4b2bcc0

Browse files
committed
RSS Feed
1 parent 30bd40f commit 4b2bcc0

File tree

6 files changed

+289
-0
lines changed

6 files changed

+289
-0
lines changed

package-lock.json

Lines changed: 203 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"dependencies": {
1515
"@astrojs/check": "^0.9.4",
16+
"@astrojs/rss": "^4.0.11",
1617
"@astrojs/svelte": "^7.0.1",
1718
"@astrojs/tailwind": "^5.1.3",
1819
"@docsearch/css": "^3.6.2",
@@ -30,6 +31,7 @@
3031
"hast-util-from-html": "^2.0.1",
3132
"hastscript": "^9.0.0",
3233
"lz-string": "^1.5.0",
34+
"markdown-it": "^14.1.0",
3335
"memfs": "^4.11.1",
3436
"monaco-editor-textmate": "^4.0.0",
3537
"monaco-textmate": "^3.0.1",
@@ -42,6 +44,7 @@
4244
"readable-stream": "^4.5.2",
4345
"rehype-autolink-headings": "^7.1.0",
4446
"rehype-slug": "^6.0.0",
47+
"sanitize-html": "^2.14.0",
4548
"svelte": "^5.8.1",
4649
"tailwindcss": "^3.4.3",
4750
"typescript": "^5.4.5",

src/components/BlogHero.astro

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,31 @@ import { Image } from "astro:assets";
44
import BlogAuthor from "./BlogAuthor.astro";
55
import ChevronRightIcon from "./icons/ChevronRightIcon.astro";
66
import DiscordIcon from "./icons/DiscordIcon.astro";
7+
import RssIcon from "./icons/RssIcon.astro";
78
import GrainLogo from "./icons/GrainLogo.astro";
89
910
interface Props {
1011
entry: CollectionEntry<"blog">;
1112
}
1213
1314
const { entry } = Astro.props;
15+
16+
const rssLink = Astro.site!.toString().replace(/\/$/, "") + "/blog/rss.xml";
1417
---
1518

1619
<div class="mx-auto max-w-[70rem] pb-5 lg:pb-28 px-4">
1720
<div class="my-6 md:my-10 flex justify-between items-center">
1821
<div>
1922
<GrainLogo class="w-8 h-8 md:w-12 md:h-12 inline-block align-middle fill-color-accent" />
2023
<span class="md:pl-1 text-2xl md:text-4xl font-semibold align-middle">The Grain Blog</span>
24+
<a
25+
href={rssLink}
26+
target="_blank"
27+
aria-label="RSS feed link"
28+
class="hidden md:inline-block ml-2 align-middle"
29+
>
30+
<RssIcon class="w-10 h-10 fill-color-accent" />
31+
</a>
2132
</div>
2233
<div class="flex md:hidden gap-4 text-color-accent items-center">
2334
<a
@@ -34,6 +45,13 @@ const { entry } = Astro.props;
3445
>
3546
<DiscordIcon class="w-7 h-7 fill-color-accent" />
3647
</a>
48+
<a
49+
href={rssLink}
50+
target="_blank"
51+
aria-label="RSS feed link"
52+
>
53+
<RssIcon class="w-7 h-7 fill-color-accent" />
54+
</a>
3755
</div>
3856
<div class="hidden md:block text-color-accent">
3957
Also find us on

src/components/OpenSourceBlurb.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import Card from "./Card.astro";
4949
backgrounds, which adds significant value to how we approach
5050
developer experience.
5151
</p>
52+
<a class="z-20 text-color-accent hover:text-color-accent-muted" href="https://github.com/sponsors/grain-lang" target="_blank">Sponsor Us →</a>
5253
</Card>
5354
<Card title="Want to be a part of Grain's development?" class="bg-gray-variant-90 dark:bg-[#2F2744] text-purple-20">
5455
<p class="text-gray-variant-50">

0 commit comments

Comments
 (0)