diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-18 19:21:59 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-18 19:21:59 +0100 |
| commit | ca8e6824eaa711105f4092365792720c9dde026b (patch) | |
| tree | 2b6493941352d11b799ee63d3f1311c13de649b8 /website/src/pages/microlog | |
| parent | a0f25057283a397f006127b6f582d190d2c4294e (diff) | |
remove Astro website
Diffstat (limited to 'website/src/pages/microlog')
| -rw-r--r-- | website/src/pages/microlog/[...slug].astro | 26 | ||||
| -rw-r--r-- | website/src/pages/microlog/index.astro | 13 | ||||
| -rw-r--r-- | website/src/pages/microlog/rss.xml.ts | 29 |
3 files changed, 0 insertions, 68 deletions
diff --git a/website/src/pages/microlog/[...slug].astro b/website/src/pages/microlog/[...slug].astro deleted file mode 100644 index 69c94b0..0000000 --- a/website/src/pages/microlog/[...slug].astro +++ /dev/null @@ -1,26 +0,0 @@ ---- -import { type CollectionEntry, getCollection, render } from 'astro:content'; -import MicrologPost from '../../layouts/MicrologPost.astro'; -import { renderGemtextToHtml } from '../../renderGemtextToHtml'; - -export async function getStaticPaths() { - const posts = await getCollection('microlog'); - return posts.map((post) => ({ - params: { slug: post.id }, - props: post, - })); -} -type Props = CollectionEntry<'microlog'>; - -const { id: slug, body } = Astro.props; -const pubDateStr = slug.replaceAll(/\.[0-9]+/g, ''); -const pubDate = new Date(pubDateStr); -if (isNaN(pubDate.valueOf())) { - throw new Error(`Could not construct a valid publication date for microlog post: ${slug}`); -} -const Content = renderGemtextToHtml(body ?? '', pubDateStr); ---- - -<MicrologPost pubDate={pubDate} title={pubDateStr}> - <Fragment set:html={Content}></Fragment> -</MicrologPost> diff --git a/website/src/pages/microlog/index.astro b/website/src/pages/microlog/index.astro deleted file mode 100644 index dd1ee16..0000000 --- a/website/src/pages/microlog/index.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- -import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts'; -import MicrologFeed from '../../components/MicrologFeed.astro'; -import Page from '../../layouts/Page.astro'; ---- - -<Page title={SITE_TITLE} description={SITE_DESCRIPTION}> - <MicrologFeed headingLevel={1}> - <!-- <section> - <p><a href="/blog/subscribe">How to subscribe to this blog</a></p> - </section> --> - </MicrologFeed> -</Page> diff --git a/website/src/pages/microlog/rss.xml.ts b/website/src/pages/microlog/rss.xml.ts deleted file mode 100644 index fa04b32..0000000 --- a/website/src/pages/microlog/rss.xml.ts +++ /dev/null @@ -1,29 +0,0 @@ -import path from "node:path"; -import rss from "@astrojs/rss"; -import type { APIContext } from "astro"; -import { getCollection } from "astro:content"; -import { renderGemtextToHtml } from "../../renderGemtextToHtml"; - -export async function GET(context: APIContext) { - // `site` is guaranteed to exist because we define it in our Astro config - const site = context.site!; - const posts = await getCollection("microlog"); - - return rss({ - title: "Joe Carstairs’ microlog", - description: "My private X feed I guess?", - customData: ` - <image>/images/headshot.webp</image> - <language>en-GB</language> - `, - site: path.join(site.toString(), "microlog"), - trailingSlash: false, - items: posts.map((post) => ({ - link: `/microlog/${post.id}`, - title: post.id, - content: renderGemtextToHtml(post.body ?? ""), - pubDate: new Date(post.id.replace(/\.[0-9]+$/g, "")), - author: "Joe Carstairs", - })), - }); -} |
