@gurupanguji

Post Date And Snippet Validation Design

Goal

Add two repository checks that work both locally and in CI:

  1. A post filename date in _posts/YYYY-MM-DD-slug.md must match the calendar day in its front matter date.
  2. A future-dated post must have a matching companion snippet in _snippets/. Locally, missing or stale snippets should be generated or refreshed before commit. In CI, validation should fail instead of mutating files.

Approach

Use one shared Python validation script and one shared Python snippet generator.

Local Hook Flow

CI Flow

Add .github/workflows/validate_posts.yml

Notes