feat: add a rss feed

This commit is contained in:
Julien Calixte
2026-05-03 18:44:48 +02:00
parent b8ec3dcff7
commit dc095af8c4
3 changed files with 102 additions and 1 deletions

36
src/pages/feed.vue Normal file
View File

@@ -0,0 +1,36 @@
<page>
path: /feed.rss
</page>
<script setup lang="ts">
import RenderFeed from "@islands/feed"
import type { FeedOptions, FeedItem } from "@islands/feed"
import { fetchNotes } from "~/api/fetch-notes"
const { site } = usePage()
const url = site.url
const options: FeedOptions = {
title: "Apoena's distracted mind",
description: "Where I write about what I read.",
id: url,
link: url,
language: "en",
image: "https://apoena.dev/pwa-512x512.png",
copyright: "No copyright, just don't forget me",
}
const notes = await fetchNotes()
const items = notes.map<FeedItem>((note) => ({
link: note.canonicalUrl,
date: new Date(note.publishedAt),
title: note.title,
content: note,
}))
</script>
<template>
<RenderFeed format="feed" :options="options" :items="items" />
</template>