Leaflet Blog in Deno Fresh

fixy

Changed files
+29 -17
components
lib
routes
+5
components/post-list-item.tsx
···
<Title className="text-lg w-full" level="h3">
{post.title}
</Title>
<PostInfo
content={post.content}
createdAt={post.createdAt}
···
<Title className="text-lg w-full" level="h3">
{post.title}
</Title>
+
{post.subtitle && (
+
<p className="text-sm text-slate-600 dark:text-slate-300 font-serif italic line-clamp-2">
+
{post.subtitle}
+
</p>
+
)}
<PostInfo
content={post.content}
createdAt={post.createdAt}
-9
lib/bsky.ts
···
-
import { CredentialManager, XRPC } from "npm:@atcute/client";
-
-
import { env } from "./env.ts";
-
-
const handler = new CredentialManager({
-
service: env.NEXT_PUBLIC_BSKY_PDS,
-
fetch,
-
});
-
export const bsky = new XRPC({ handler });
···
+7 -1
routes/post/[slug].tsx
···
uri: string;
value: {
title: string;
content: string;
createdAt: string;
};
···
<>
<Head>
<title>{post.value.title} — knotbin</title>
-
<meta name="description" content="by Roscoe Rubin-Rottenberg" />
{/* Merge GFM's default styles with our dark-mode overrides */}
<style
dangerouslySetInnerHTML={{ __html: CSS + transparentDarkModeCSS }}
···
<article class="w-full space-y-8">
<div class="space-y-4 w-full">
<Title>{post.value.title}</Title>
<PostInfo
content={post.value.content}
createdAt={post.value.createdAt}
···
uri: string;
value: {
title: string;
+
subtitle?: string;
content: string;
createdAt: string;
};
···
<>
<Head>
<title>{post.value.title} — knotbin</title>
+
<meta name="description" content={post.value.subtitle || "by Roscoe Rubin-Rottenberg"} />
{/* Merge GFM's default styles with our dark-mode overrides */}
<style
dangerouslySetInnerHTML={{ __html: CSS + transparentDarkModeCSS }}
···
<article class="w-full space-y-8">
<div class="space-y-4 w-full">
<Title>{post.value.title}</Title>
+
{post.value.subtitle && (
+
<p class="text-xl text-slate-600 dark:text-slate-300 font-serif italic">
+
{post.value.subtitle}
+
</p>
+
)}
<PostInfo
content={post.value.content}
createdAt={post.value.createdAt}
+17 -7
routes/rss.ts
···
});
for (const post of posts) {
rss.item({
title: post.value.title ?? "Untitled",
-
description: await unified()
-
.use(remarkParse)
-
.use(remarkRehype)
-
.use(rehypeFormat)
-
.use(rehypeStringify)
-
.process(post.value.content)
-
.then((v) => v.toString()),
url: `https://knotbin.com/post/${post.uri.split("/").pop()}`,
date: new Date(post.value.createdAt ?? Date.now()),
});
···
});
for (const post of posts) {
+
const description = post.value.subtitle
+
? `${post.value.subtitle}\n\n${await unified()
+
.use(remarkParse)
+
.use(remarkRehype)
+
.use(rehypeFormat)
+
.use(rehypeStringify)
+
.process(post.value.content)
+
.then((v) => v.toString())}`
+
: await unified()
+
.use(remarkParse)
+
.use(remarkRehype)
+
.use(rehypeFormat)
+
.use(rehypeStringify)
+
.process(post.value.content)
+
.then((v) => v.toString());
+
rss.item({
title: post.value.title ?? "Untitled",
+
description,
url: `https://knotbin.com/post/${post.uri.split("/").pop()}`,
date: new Date(post.value.createdAt ?? Date.now()),
});