ReadingEntry component renders individual reading/knowledge entries from a Notion database, typically used on the reading log page.
Component Location
File:src/components/ReadingEntry.astro
Props
Notion page object containing the reading entry data
Interface
src/components/ReadingEntry.astro
Expected Notion Properties
The component expects the following properties in the Notion page:Tags for the entry. Special tag “wow” displays in red.
URL link to the content being referenced
Notes, comments, or quotes from the reading
Date of the reading/entry (ISO format)
Usage
src/pages/read.astro
Rendering Logic
The component renders:- “wow” Tag: If present, displays as red text
- Link: Underlined link using the “Comments and Quotes” property as link text
- Date: Formatted as “MMM d” (e.g., “Jan 15”)
- Other Tags: Displayed in gray with # prefix
Example Output
Styling
The component uses Tailwind CSS classes:- “wow” tag:
text-red-500(red emphasis) - Link:
underline(underlined text) - Other tags:
text-gray-400(muted gray)
Helper Functions
The component uses:- parseProperty: Extracts property values from Notion page objects
- format: Formats dates (from date-fns)
- parseISO: Parses ISO date strings (from date-fns)
Date Formatting
Notion Database Schema
Expected database columns:| Property | Type | Description |
|---|---|---|
| Tags | Multi-select | Categories/tags (special: “wow”) |
| Link | URL | Link to content |
| Comments and Quotes | Text | Notes/quotes |
| Date | Date | Entry date |
Related Components
Pages Management
Learn about static pages in Notion
Notion Parse Utility
parseProperty and other parsing utilities