Something went wrong. Try again.
🌐 little site of mines angelcube.dev
astro personal-site
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475---import Nav from "../../components/nav.astro";import "../../styles/journal.scss";import { getCollection } from "astro:content";import { Temporal } from "temporal-polyfill";
type PostType = "Ramblings" | "Writings";
async function getSortedPosts(type: PostType) { return ( await getCollection("journal", ({ data }) => { return data.type === type; }) ).sort( (a: any, b: any) => Temporal.PlainDate.compare(b.data.published_date, a.data.published_date) )}
const writings = await getSortedPosts("Writings")const ramblings = await getSortedPosts("Ramblings")---
<!doctype html><html lang="en-CA"> <head> <!-- Important metadata, and the like --> <meta charset="UTF-8" /> <meta name="viewport" content="width = device-width, initial-scale = 1" /> <title>journal · angelcube</title>
<!-- Favicon --> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /> <link rel="icon" type="image/svg+xml" sizes="any" href="/favicon.svg" /> </head>
<body> <main> <header> <Nav title="← return home" href="/" /> <div class="title"> <h1>journal →</h1> <p class="description">Words I wanted to say.</p> </div> </header> <h2>writings</h2> <ul class="post-list"> {writings.map((post: any) => ( <li> <div class="post-meta"> <span class="published-date">{post.data.published_date}</span> <span class="description">{post.data.description}</span> </div> <a href={`/journal/${post.id}`}>{post.data.title}</a> </li> ))} </ul> <h2>ramblings</h2> <ul class="post-list"> {ramblings.map((post: any) => ( <li> <div class="post-meta"> <span class="published-date">{post.data.published_date}</span> <span class="description">{post.data.description}</span> </div> <a href={`/journal/${post.id}`}>{post.data.title}</a> </li> ))} </ul> </main> </body></html>