Compare commits

...

2 Commits

Author SHA1 Message Date
Anton Pogrebnjak 7ce707817d Added slashes page 2026-05-03 01:11:46 +02:00
Anton Pogrebnjak 59e1df4436 Updated rss feeds 2026-05-03 00:53:30 +02:00
6 changed files with 103 additions and 13 deletions
+7 -1
View File
@@ -4,11 +4,17 @@ import Socials from "./Socials.astro";
--- ---
<footer> <footer>
&copy; {today.getFullYear()} <a href="/about">Anton</a>. All rights reserved. <p>&copy; {today.getFullYear()} <a href="/about">Anton</a>. All rights reserved.</p>
<Socials /> <Socials />
<div>
<a href="/slashes">/slashes</a> <a href="/slashes#rss">/rss</a>
</div>
</footer> </footer>
<style> <style>
footer { footer {
display: flex;
flex-direction: column;
gap: .5rem;
background-color: var(--background-soft); background-color: var(--background-soft);
padding: 1rem 1rem 2rem; padding: 1rem 1rem 2rem;
width: 100%; width: 100%;
+1 -1
View File
@@ -2,4 +2,4 @@
// You can import this data from anywhere in your site by using the `import` keyword. // You can import this data from anywhere in your site by using the `import` keyword.
export const SITE_TITLE = 'Pantosite'; export const SITE_TITLE = 'Pantosite';
export const SITE_DESCRIPTION = 'The personal Blog of one Anton Pogrebnjak'; export const SITE_DESCRIPTION = 'The personal website of Anton';
+17
View File
@@ -0,0 +1,17 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
export async function GET(context) {
const posts = await getCollection('blog');
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site,
items: posts.map((post) => ({
...post.data,
link: `/blog/${post.id}/`,
})),
});
}
+17
View File
@@ -0,0 +1,17 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
export async function GET(context) {
const posts = await getCollection('projects');
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site,
items: posts.map((post) => ({
...post.data,
link: `/projects/${post.id}/`,
})),
});
}
+12 -4
View File
@@ -4,13 +4,21 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
export async function GET(context) { export async function GET(context) {
const posts = await getCollection('blog'); const posts = await getCollection('blog');
const projects = await getCollection('projects');
let unifiedItems = posts.map((post) => ({
...post.data,
link: `/blog/${post.id}/`,
})).concat(projects.map((project) => ({
...project.data,
link: `/projects/${project.id}/`
})));
unifiedItems = unifiedItems.sort((a, b) => b.pubDate - a.pubDate);
return rss({ return rss({
title: SITE_TITLE, title: SITE_TITLE,
description: SITE_DESCRIPTION, description: SITE_DESCRIPTION,
site: context.site, site: context.site,
items: posts.map((post) => ({ items: unifiedItems,
...post.data,
link: `/blog/${post.id}/`,
})),
}); });
} }
+42
View File
@@ -0,0 +1,42 @@
---
import BaseHead from "../components/BaseHead.astro";
import Header from "../components/Header.astro";
import Main from "../components/Main.astro";
import Footer from "../components/Footer.astro";
import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
---
<!doctype html>
<html lang="en">
<head>
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
</head>
<body>
<Header />
<Main>
<div>
<h1>Slashes</h1>
<h2>Pages</h2>
<ul>
<li><a href="/projects">/projects</a> Projects I have worked on</li>
<li><a href="/photography">/photography</a> Some of my photographic work &mdash; still a work in progress</li>
<li><a href="/blog">/blog</a> Some essays and freeform writing on various topics</li>
<li><a href="/about">/about</a> If you care about who I am</li>
</ul>
<h2 id="rss">RSS Feeds</h2>
<p>If you want to subscribe to any content you may use any of the following rss feeds.</p>
<ul>
<li><a href="/blog/rss.xml">/blog/rss.xml</a> Blog posts about various topics</li>
<li><a href="/projects/rss.xml">/projects/rss.xml</a> Posts about projects I have worked on</li>
<li><a href="/rss.xml">/rss.xml</a> All feeds in one</li>
</ul>
</div>
</Main>
<Footer />
</body>
<style>
</style>
</html>