RSS feed (no content)

This commit is contained in:
Filipe Medeiros 2024-03-30 19:19:18 +01:00
parent eabbc015e8
commit 9aed8605b2
Signed by: filipe
GPG Key ID: 9533BD5467CC1E78
11 changed files with 70 additions and 44 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -14,6 +14,7 @@
},
"dependencies": {
"@astrojs/mdx": "^1.1.5",
"@astrojs/rss": "^4.0.5",
"@astrojs/tailwind": "^5.0.3",
"astro": "^4.0.6",
"mdast-flatten-listitem-paragraphs": "^1.0.0",

View File

@ -1,11 +1,9 @@
---
import type { HTMLAttributes } from 'astro/types';
export interface Props extends HTMLAttributes<'a'> {
isExternal?: boolean;
}
export type Props = HTMLAttributes<'a'>;
const { isExternal = false } = Astro.props;
const isExternal = Astro.props.href?.toString().startsWith('https://');
---
<a

View File

@ -1,6 +1,6 @@
title: Blindness
checkedOut: true
link: 'https://example.com'
link: 'https://openlibrary.org/works/OL27420W/Ensaio_Sobre_a_Cegueira?edition=key%3A/books/OL352517M'
date: 2024-03-13
mainAuthor: José Saramago
description: >

View File

@ -1,6 +1,8 @@
title: One hundred years of solitude CONFIRMAR
title: One hundred years of solitude
checkedOut: false
link: 'https://example.com'
link: 'https://openlibrary.org/works/OL274505W/Cien_a%C3%B1os_de_soledad?edition=key%3A/books/OL30448691M'
date: 2024-03-14
mainAuthor: Gabriel García Márquez
description: Currently reading :)
description: >
Currently reading! :) Also using it to learn Spanish, since
I'm trying to become fluent.

View File

@ -1,6 +1,6 @@
title: Sputnik sweetheart
checkedOut: true
link: 'https://example.com'
link: 'https://openlibrary.org/works/OL2625443W/%E3%82%B9%E3%83%97%E3%83%BC%E3%83%88%E3%83%8B%E3%82%AF%E3%81%AE%E6%81%8B%E4%BA%BA?edition=key%3A/books/OL7426986M'
date: 2024-03-13
mainAuthor: Haruki Murakami
description: >

View File

@ -1,6 +1,6 @@
title: Ensaio sobre a cegueira
checkedOut: true
link: 'https://example.com'
link: 'https://openlibrary.org/books/OL9162940M/Ensaio_Sobre_a_Cegueira'
date: 2024-03-13
mainAuthor: José Saramago
description: >

View File

@ -1,6 +1,8 @@
title: Cem anos de solidão
checkedOut: false
link: 'https://example.com'
link: 'https://openlibrary.org/works/OL26414960W/Cem_Anos_De_Solid%C3%A3o?edition=key%3A/books/OL35663961M'
date: 2024-03-14
mainAuthor: Gabriel García Márquez
description: A ler :)
description: >
A ler! :) Estou também a aproveitar para aprender mais espanhol,
porque quero tornar-me fluente.

View File

@ -17,6 +17,12 @@ const hasFooter = !!footer;
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/favicon" href="/favicon.ico" />
<link
rel="alternate"
type="application/rss+xml"
title="Filipe Medeiros"
href={`${Astro.site}feed.xml`}
/>
<slot name="metadata" />
</head>
<body class="bg-orange-50 font-serif">
@ -47,17 +53,20 @@ const hasFooter = !!footer;
</ul>
<ul class="flex gap-3">
<li>
<InlineLink isExternal href="https://social.filipesm.eu/@filipe">
<InlineLink href="/feed.xml">RSS</InlineLink>
</li>
<li>
<InlineLink href="https://social.filipesm.eu/@filipe">
Fediverso
</InlineLink>
</li>
<li>
<InlineLink isExternal href="https://git.filipesm.eu/filipe">
<InlineLink href="https://git.filipesm.eu/filipe">
<span class="italic">Software</span>
</InlineLink>
</li>
<li>
<InlineLink isExternal href="https://bandcamp.com/filipesm">
<InlineLink href="https://bandcamp.com/filipesm">
Bandcamp
</InlineLink>
</li>

36
src/pages/feed.xml.js Normal file
View File

@ -0,0 +1,36 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import mdx from '@astrojs/mdx';
/**
* @type {import('astro').APIRoute}
*/
export async function GET(context) {
const [blogPosts, libraryItems] = await Promise.all([
getCollection('blog'),
getCollection('library'),
]);
return rss({
title: 'Filipe Medeiros - personal website',
description:
"Filipe Medeiros' personal website. It has a blog and a library with things he's read or seen.",
site: context.site,
items: libraryItems
.map((item) => ({
title: item.data.title,
pubDate: item.data.date,
description: item.data.description,
itemLink: item.data.link,
}))
.concat(
blogPosts.map((post) => ({
title: post.data.title,
pubDate: post.data.publishDate,
description: post.data.summary,
link: `${post.id.startsWith('en/') ? '/blog' : '/blogue'}/${
post.slug
}`,
})),
),
});
}

View File

@ -20,13 +20,10 @@ import Layout from '../layouts/Layout.astro';
<p class="mb-3">
I like animals, politics, reading about economics. I don't like to cook
(yet) and I don't like cold wind. Occasionally, I like to program some
stuff and take care of my <InlineLink
isExternal
href="https://git.filipesm.eu"
>
stuff and take care of my <InlineLink href="https://git.filipesm.eu">
{'little'}
</InlineLink>{' '}
<InlineLink isExternal href="https://social.filipesm.eu">
<InlineLink href="https://social.filipesm.eu">
{'corner'}
</InlineLink> on the internet.
</p>
@ -34,26 +31,18 @@ import Layout from '../layouts/Layout.astro';
I'm an ecologial and environmental activist (I help environmental
organisations
<InlineLink
isExternal
href="https://sicnoticias.pt/pais/2023-05-13-Gas-e-morte-morte-e-Gas-mais-de-150-ativistas-em-marcha-no-centro-de-Sines-b856581e"
>
{'from time to time'}
</InlineLink>) and I support <InlineLink
isExternal
href="https://wikipedia.org/wiki/Ecossocialism"
>
{'ecosocialism CONFIRMAR'}
</InlineLink> (I'm a member of <InlineLink
isExternal
href="https://diem25.org"
>
</InlineLink> (I'm a member of <InlineLink href="https://diem25.org">
{'DiEM25'}
</InlineLink>, of <InlineLink isExternal href="https://partidolivre.pt">
</InlineLink>, of <InlineLink href="https://partidolivre.pt">
{'LIVRE'}
</InlineLink> and of the <InlineLink
isExternal
href="https://ecolecon.eu"
>
</InlineLink> and of the <InlineLink href="https://ecolecon.eu">
{'European Society for Ecological Economics'}
</InlineLink>).
</p>
@ -62,25 +51,19 @@ import Layout from '../layouts/Layout.astro';
That means I'm not really interested in making ultra-advanced robots, but
more interested in helping people from the whole world live together and
be happy. I'm in favor of <InlineLink
isExternal
href="https://www.w3.org/standards/faq#std"
class="italic"
>
{'standards'}
</InlineLink>, free libre open source software (<InlineLink
isExternal
href="https://git.filipesm.eu/filipe/personal-website"
>
{'just like this wesbite!'}
</InlineLink>), <InlineLink
isExternal
href="https://wikipedia.org/wiki/Copyleft"
>
</InlineLink>), <InlineLink href="https://wikipedia.org/wiki/Copyleft">
<span class="italic">{'copyleft'}</span> licenses
</InlineLink>
and
<InlineLink
isExternal
href="https://www.ica.coop/en/cooperatives/what-is-a-cooperative"
>
{'cooperatives'}
@ -88,25 +71,22 @@ import Layout from '../layouts/Layout.astro';
</p>
<p class="mb-3">
I'm very passionate about <InlineLink
isExternal
href="https://doughnuteconomics.org/about-doughnut-economics"
>
{'Doughnut Economics'}
</InlineLink> and political, social and ecological/environmental economics.
I used to be a progammer. These day I study <InlineLink
isExternal
href="https://wikipedia.org/wiki/System_Dynamics"
>
{'system dynamics'}
</InlineLink>
at the <InlineLink isExternal href="https://www.uib.no">
at the <InlineLink href="https://www.uib.no">
{'University of Bergen'}
</InlineLink>, so that one day I can be an economist or build policies
(not to be a politician); who knows, maybe for the Europen Union.
</p>
<p class="mb-3">
I live (at the moment) in <InlineLink
isExternal
href="https://www.bergen.kommune.no"
>
{'Bergen, Norway'}
@ -121,12 +101,10 @@ import Layout from '../layouts/Layout.astro';
<p>
This website tries to be as sustainable as possible: we save energy on
your device and on servers. It's powered by renewables (courtesy of <InlineLink
isExternal
href="https://uberspace.de"
>
{'Uberspace'}
</InlineLink>) and heavily inspired by <InlineLink
isExternal
href="https://solar.lowtechmagazine.com"
>
{"Low Tech Magazine's solar version"}