From edd3b0972115ebddd068ed226158ace07c706401 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Sun, 9 Aug 2026 19:32:06 -0400 Subject: feature: add a reading page --- src/components/ReadingEntry.astro | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/components/ReadingEntry.astro (limited to 'src/components/ReadingEntry.astro') diff --git a/src/components/ReadingEntry.astro b/src/components/ReadingEntry.astro new file mode 100644 index 0000000..3fa7860 --- /dev/null +++ b/src/components/ReadingEntry.astro @@ -0,0 +1,62 @@ +--- +import type { CollectionEntry } from "astro:content"; + +type ReadingYear = CollectionEntry<"reading">; +type Entry = ReadingYear["data"]["entries"][number]; + +interface Props { + entry: Entry; +} + +const { entry } = Astro.props; + +const href = + entry.url ?? + (entry.isbn ? `https://openlibrary.org/isbn/${entry.isbn}` : undefined); +const isReading = entry.status === "reading"; +const statusLabel = isReading ? "Currently reading" : "Finished"; +--- + +
  • +

    + + { + !isReading && ( + + ) + } + + { + href ? ( + {entry.title} + ) : ( + {entry.title} + ) + } + {entry.author && by {entry.author}} +

    + {entry.note &&
    {entry.note}
    } + { + entry.isbn && ( + + ) + } +
  • -- cgit v1.2.1