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:
- Filename prefix:
2024-01-15-post.md - Git last modified: Most recent commit touching file
- File mtime: Filesystem modification time
Git Detection
Vibe Site automatically detects if the source directory is a git repository.
If not a git repo:
- Git dates are skipped
- Falls back to filesystem dates
- No errors, just warnings
Benefits
- Accurate dates: Based on actual edit history
- No external deps: Pure Rust implementation
- Graceful fallback: Works without git
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