Action

Type

Resolved On

Diary YearFeature2025-12-22

Description

This feature enables organizing and viewing tech diaries across different years. Currently, diaries may not have a clear year-based organization system. This feature would allow users to maintain separate diary entries organized by year, making it easier to review historical tech insights, learnings, and decisions over time.

Purpose

  • Organize tech diaries chronologically by year
  • Maintain historical records of decisions and learnings
  • Enable year-over-year reflection and analysis
  • Support long-term knowledge management

Implementation Approaches

Two main approaches are possible:

Create separate directories for each year:

src/content/diaries/
  2024/
    entry-1.md
    entry-2.md
  2025/
    entry-1.md
    entry-2.md
  2026/
    entry-1.md

Advantages:

  • Clear visual organization in file system
  • Easier to manage and archive old years
  • Scales better as content grows
  • Natural separation prevents mixing years
  • Simpler querying by year in code

Disadvantages:

  • Requires more folder structure management
  • Collection configuration needs to support multiple directories

Option 2: Front-Matter Metadata

Add year field to markdown front-matter:

---
year: 2025
month: 12
title: Entry Title
---

Advantages:

  • Simpler file structure
  • Single collection to manage
  • More flexibility for filtering

Disadvantages:

  • Relies on consistent front-matter discipline
  • Harder to visually scan file system
  • Risk of year field being omitted
  • Less clear organizational boundaries

Recommendation

Use Option 1: Folder Structure by Year

This approach provides better organizational clarity, scalability, and maintainability. The year becomes a structural element rather than metadata, making the distinction between years explicit and harder to accidentally violate.

Implementation Steps

  1. Reorganize existing diary content into year-based folders
  2. Update collection configuration to support year-based paths
  3. Add year navigation to diary interface
  4. Update all diary links and references
  5. Consider archiving older years if needed

Implementation Summary

Option 1: Folder Structure by Year (IMPLEMENTED)

Successfully implemented year-based organization for weeks (diary entries):

Files Modified:

  • src/content/config.ts: Added year field to weeksCollection schema
  • src/components/planner/benben/Diary.astro: Updated to accept year prop and construct paths as year/wkX
  • All week detail pages (6 files): Updated to pass year prop to Diary component

Folder Structure:

src/content/weeks/
  └── 2025/
      ├── wk27.md
      ├── wk28.md
      ├── wk36.md
      ├── wk37.md
      ├── wk42.md
      ├── wk43.md
      ├── wk45.md
      ├── wk51.md
      └── first-entry.md (sample)

Key Benefits Achieved:

  • Clear visual organization by year in file system
  • Scalable structure for adding new years (2026, 2027, etc.)
  • Simple querying by year using path structure
  • Natural separation of historical data
  • Consistent with existing weeks workflow

Backward Compatibility:

  • The Diary component intelligently handles year context from parent pages
  • All existing week links continue to work
  • Dynamic year defaults to 2025 for current/base pages