mirror of
https://github.com/andwati/andwati.com.git
synced 2026-11-06 01:22:15 +00:00
Adds a custom Astro loader that reads the Zola-style TOML frontmatter (+++ ... +++) directly, so content/ stays the single source of truth with no YAML conversion step. Defines writings/portfolio/bookshelf/ blogs collections and basic list/detail pages for each, rendering the seed entries end-to-end (verified in-browser via `pnpm --filter site dev`). This is the first runnable MVP: home, writings list + post detail, portfolio, bookshelf (books and papers), and curated blogs all render from real content/ files.
23 lines
670 B
Plaintext
23 lines
670 B
Plaintext
---
|
|
import { getCollection } from "astro:content";
|
|
import Base from "../../layouts/Base.astro";
|
|
|
|
const writings = (
|
|
await getCollection("writings", ({ data }) => !data.draft)
|
|
).sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
|
|
---
|
|
|
|
<Base title="Writings">
|
|
<h1>Writings</h1>
|
|
{
|
|
writings.map((entry) => (
|
|
<div class="card">
|
|
<h3><a href={`/writings/${entry.id}/`}>{entry.data.title}</a></h3>
|
|
<p class="meta">{entry.data.date.toDateString()}</p>
|
|
{entry.data.description && <p>{entry.data.description}</p>}
|
|
{entry.data.taxonomies?.tags.map((tag) => <span class="tag">#{tag}</span>)}
|
|
</div>
|
|
))
|
|
}
|
|
</Base>
|