bim

Git Integration

Vibe Site uses git for date extraction without external commands.

How It Works

The git2 Rust crate reads git history directly. No git command needed.

Date Priority

Dates are extracted in this order:

  1. Filename prefix: 2024-01-15-post.md
  2. Git last modified: Most recent commit touching file
  3. File mtime: Filesystem modification time

Git Detection

Vibe Site automatically detects if the source directory is a git repository.

If not a git repo:

Benefits

Example

blog/
  my-post.md           # Date from git or mtime
  2024-01-15-dated.md  # Date from filename (highest priority)

CI/CD Consideration

In CI environments, ensure full git history:

# GitHub Actions
- uses: actions/checkout@v4
  with:
    fetch-depth: 0  # Full history for accurate dates

Shallow clones may give incorrect dates.

Related: #git #dates #metadata @documentation