Leaflet Blog in Deno Fresh

fixy

Changed files
+29 -17
components
lib
routes
+5
components/post-list-item.tsx
··· 72 72 <Title className="text-lg w-full" level="h3"> 73 73 {post.title} 74 74 </Title> 75 + {post.subtitle && ( 76 + <p className="text-sm text-slate-600 dark:text-slate-300 font-serif italic line-clamp-2"> 77 + {post.subtitle} 78 + </p> 79 + )} 75 80 <PostInfo 76 81 content={post.content} 77 82 createdAt={post.createdAt}
-9
lib/bsky.ts
··· 1 - import { CredentialManager, XRPC } from "npm:@atcute/client"; 2 - 3 - import { env } from "./env.ts"; 4 - 5 - const handler = new CredentialManager({ 6 - service: env.NEXT_PUBLIC_BSKY_PDS, 7 - fetch, 8 - }); 9 - export const bsky = new XRPC({ handler });
+7 -1
routes/post/[slug].tsx
··· 12 12 uri: string; 13 13 value: { 14 14 title: string; 15 + subtitle?: string; 15 16 content: string; 16 17 createdAt: string; 17 18 }; ··· 110 111 <> 111 112 <Head> 112 113 <title>{post.value.title} — knotbin</title> 113 - <meta name="description" content="by Roscoe Rubin-Rottenberg" /> 114 + <meta name="description" content={post.value.subtitle || "by Roscoe Rubin-Rottenberg"} /> 114 115 {/* Merge GFM's default styles with our dark-mode overrides */} 115 116 <style 116 117 dangerouslySetInnerHTML={{ __html: CSS + transparentDarkModeCSS }} ··· 124 125 <article class="w-full space-y-8"> 125 126 <div class="space-y-4 w-full"> 126 127 <Title>{post.value.title}</Title> 128 + {post.value.subtitle && ( 129 + <p class="text-xl text-slate-600 dark:text-slate-300 font-serif italic"> 130 + {post.value.subtitle} 131 + </p> 132 + )} 127 133 <PostInfo 128 134 content={post.value.content} 129 135 createdAt={post.value.createdAt}
+17 -7
routes/rss.ts
··· 21 21 }); 22 22 23 23 for (const post of posts) { 24 + const description = post.value.subtitle 25 + ? `${post.value.subtitle}\n\n${await unified() 26 + .use(remarkParse) 27 + .use(remarkRehype) 28 + .use(rehypeFormat) 29 + .use(rehypeStringify) 30 + .process(post.value.content) 31 + .then((v) => v.toString())}` 32 + : await unified() 33 + .use(remarkParse) 34 + .use(remarkRehype) 35 + .use(rehypeFormat) 36 + .use(rehypeStringify) 37 + .process(post.value.content) 38 + .then((v) => v.toString()); 39 + 24 40 rss.item({ 25 41 title: post.value.title ?? "Untitled", 26 - description: await unified() 27 - .use(remarkParse) 28 - .use(remarkRehype) 29 - .use(rehypeFormat) 30 - .use(rehypeStringify) 31 - .process(post.value.content) 32 - .then((v) => v.toString()), 42 + description, 33 43 url: `https://knotbin.com/post/${post.uri.split("/").pop()}`, 34 44 date: new Date(post.value.createdAt ?? Date.now()), 35 45 });