Leaflet Blog in Deno Fresh
1import PostList from "../islands/post-list.tsx";
2import { Title } from "../components/typography.tsx";
3import { getPosts } from "../lib/api.ts";
4import { Layout } from "../islands/layout.tsx";
5
6export const dynamic = "force-static";
7export const revalidate = 3600; // 1 hour
8
9const stupidSelfDeprecatingTaglinesToTryToPretendImSelfAware = [
10 "is looking into it",
11 "i think therefore imdb",
12 "isn't a real word",
13 "enjoys each protocol equally",
14 "is having a very semantic argument",
15 "wrote these derivitive taglines",
16 "is way too into css animations",
17 "uses dark mode at noon",
18 "overthinks variable names",
19 "git pushes with -f",
20 "formats on save",
21 "is praising kier",
22 "pretends to understand monads",
23 "brags about their vim config",
24 "documents their code (lies)",
25 "isn't mysterious or important",
26 "wants to be included in discourse",
27 "is deeply offended by semicolons",
28 "is morraly opposed to touching grass",
29];
30
31function getRandomTagline() {
32 return stupidSelfDeprecatingTaglinesToTryToPretendImSelfAware[
33 Math.floor(
34 Math.random() *
35 stupidSelfDeprecatingTaglinesToTryToPretendImSelfAware.length,
36 )
37 ];
38}
39
40export default async function Home() {
41 const posts = await getPosts();
42 const tagline = getRandomTagline();
43
44 return (
45 <Layout>
46 <div class="p-8 pb-20 gap-16 sm:p-20">
47 <div class="max-w-[600px] mx-auto">
48 <Title class="font-serif-italic text-4xl sm:text-5xl lowercase mb-12">
49 Knotbin
50 </Title>
51
52 <div class="space-y-4 w-full">
53 <PostList posts={posts} />
54 </div>
55 </div>
56 </div>
57 </Layout>
58 );
59}