Skip to content

Commit d79b087

Browse files
committed
feat: advertise rss
1 parent 7ee8679 commit d79b087

File tree

11 files changed

+326
-126
lines changed

11 files changed

+326
-126
lines changed

.changeset/gold-months-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"r.obin.ch": patch
3+
---
4+
5+
Advertise RSS

astro.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { remarkGitInfo } from "./src/remark/remark-git-info";
88
import { remarkExcerpt } from "./src/remark/remark-excerpt";
99
import search from "./src/integrations/search";
1010
import sitemap from "@astrojs/sitemap";
11+
import Icons from "unplugin-icons/vite";
1112

12-
// https://astro.build/config
1313
export default defineConfig({
1414
prefetch: true,
1515
build: {
@@ -49,6 +49,7 @@ export default defineConfig({
4949
},
5050
},
5151
}),
52+
Icons({ compiler: "astro" }),
5253
],
5354
},
5455
integrations: [search(), mdx(), sitemap({ i18n: { defaultLocale: C.DEFAULT_LOCALE, locales: C.LOCALES } })],

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,20 @@
4242
"rehype-slug": "^6.0.0",
4343
"sharp": "^0.34.3",
4444
"simple-git": "^3.28.0",
45+
"unplugin-icons": "^22.2.0",
4546
"vfile": "^6.0.3"
4647
},
4748
"devDependencies": {
4849
"@changesets/cli": "^2.29.6",
49-
"@eslint/js": "^9.33.0",
50+
"@eslint/js": "^9.34.0",
51+
"@iconify/json": "^2.2.377",
5052
"@openscript/unplugin-favicons": "^1.1.7",
5153
"@types/mdast": "^4.0.4",
5254
"@types/node": "^24.3.0",
5355
"@typescript-eslint/parser": "^8.40.0",
5456
"@vitest/coverage-v8": "3.2.4",
5557
"astro-eslint-parser": "^1.2.2",
56-
"eslint": "^9.33.0",
58+
"eslint": "^9.34.0",
5759
"eslint-config-prettier": "^10.1.8",
5860
"eslint-plugin-astro": "^1.3.1",
5961
"eslint-plugin-jsx-a11y": "^6.10.2",

pnpm-lock.yaml

Lines changed: 252 additions & 113 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
---
3+
4+
import LatestBlogsSection from '../../../layouts/sections/LatestBlogsSection.astro';
5+
import Button from '../../../components/Button.astro';
6+
7+
<LatestBlogsSection locale="de">
8+
9+
<Button href="/de/blog" slot="call-to-action">Alle anzeigen</Button>
10+
11+
</LatestBlogsSection>

src/content/sections/en/intro.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import FidgetCheckboxes from '../../../components/fidget/FidgetCheckboxes.astro'
66
import Button from '../../../components/Button.astro';
77

88
<IntroSection>
9+
910
<Fragment slot="title">My life between bits and bytes.</Fragment>
1011
<FidgetCheckboxes slot="spotlight" />
1112

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
---
3+
4+
import LatestBlogsSection from '../../../layouts/sections/LatestBlogsSection.astro';
5+
import Button from '../../../components/Button.astro';
6+
7+
<LatestBlogsSection locale="en">
8+
9+
<Button href="/blog" slot="call-to-action">Show all</Button>
10+
11+
</LatestBlogsSection>

src/layouts/DefaultLayout.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,7 @@ footer nav ul .active {
265265
font-weight: bold;
266266
}
267267

268-
#topbar,
269-
header,
270-
main,
271-
footer {
268+
body > :is(#topbar, header, main, footer) {
272269
padding-left: var(--padding-page);
273270
padding-right: var(--padding-page);
274271
}

src/layouts/sections/LatestBlogsSection.astro

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { render } from "astro:content";
88
import slug from "limax";
99
import Card from "../../components/Card.astro";
1010
import DateTime from "../../components/DateTime.astro";
11+
import VscodeIconsFileTypeRss from "~icons/vscode-icons/file-type-rss";
1112
1213
type Props = {
1314
locale: string;
@@ -31,6 +32,22 @@ const filteredPosts = posts.slice(0, 4);
3132
gap: 4rem;
3233
}
3334

35+
header {
36+
display: flex;
37+
justify-content: space-between;
38+
align-items: center;
39+
40+
div {
41+
display: flex;
42+
align-items: center;
43+
gap: 1rem;
44+
45+
a {
46+
display: flex;
47+
}
48+
}
49+
}
50+
3451
@media (max-width: 1280px) {
3552
section :global(ul) {
3653
grid-template-columns: 1fr;
@@ -39,7 +56,15 @@ const filteredPosts = posts.slice(0, 4);
3956
</style>
4057

4158
<section>
42-
<h2>{t("latestPostsLabel")}</h2>
59+
<header>
60+
<h2>{t("latestPostsLabel")}</h2>
61+
<div>
62+
<a href={`/rss-${locale}.xml`}>
63+
<VscodeIconsFileTypeRss style={{ fontSize: "1.5rem" }} />
64+
</a>
65+
<slot name="call-to-action" />
66+
</div>
67+
</header>
4368
<CardList>
4469
{
4570
filteredPosts.map(async (post, i) => {

src/pages/[...locale]/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
import DefaultLayout from "../../layouts/DefaultLayout.astro";
33
import { getEntry } from "astro:content";
4-
import LatestBlogsSection from "../../layouts/sections/LatestBlogsSection.astro";
54
import { render } from "astro:content";
65
import { generateGetStaticIndexPaths } from "../../utils/paths";
76
@@ -11,6 +10,7 @@ const {
1110
data: { locale },
1211
} = Astro.props;
1312
const { Content: IntroSection } = await render(await getEntry("sections", `${locale}/intro`)!);
13+
const { Content: LatestBlogsSection } = await render(await getEntry("sections", `${locale}/latest-blogs`)!);
1414
---
1515

1616
<style>
@@ -21,5 +21,5 @@ const { Content: IntroSection } = await render(await getEntry("sections", `${loc
2121

2222
<DefaultLayout translations={translations}>
2323
<IntroSection />
24-
<LatestBlogsSection locale={locale} />
24+
<LatestBlogsSection />
2525
</DefaultLayout>

0 commit comments

Comments
 (0)