v0.2.2 - Single `git` call for authors and dates (#172)
🌟 Summary
v0.2.2 makes the MkDocs Ultralytics Plugin faster and more efficient by centralizing all git metadata lookups, while also improving the GitHub issue experience with structured templates and helpful links. 🚀
📊 Key Changes
-
🧠 Single git metadata pass for all pages (PR #172)
- Adds
MetaPlugin.on_configto compute git metadata (repo URL + git log map) once at build time. - Introduces
build_git_mapinprocessor.pyto gather creation/modified dates and author emails for all Markdown files using a singlegit logcommand. - Updates
get_git_infoto read from cachedgit_datainstead of runninggit log/git blameper file. - Passes
git_dataandrepo_urlintoprocess_htmlandprocess_html_file, ensuring all HTML processing can reuse the same metadata.
- Adds
-
⚙️ Faster postprocessing with progress feedback (PR #172)
postprocess_sitenow builds a shared git map for all source files before processing HTML.- Integrates optional
TQDMprogress bars (whenultralyticsis installed) to show per-file progress during postprocessing. - Adds a pluggable
logcallback toprocess_html_fileso messages can be routed through TQDM or standard output cleanly. - Improves error handling and logging for file read/write issues while keeping verbose output optional.
-
✍️ Smarter author resolution (PR #172)
get_github_usernames_from_filenow uses precomputed email counts (frombuild_git_map) instead of running git commands itself.- Accepts an optional
repo_urlto build consistent author profile links, falling back to an Ultralytics repo URL when unavailable. - Reduces duplicate git calls and centralizes all git access in one place.
-
🧩 New GitHub issue templates for better collaboration (PR #171)
- Adds structured templates for:
- 🐛 Bug Reports
- 🚀 Feature Requests
- ❓ Questions
- Provides a
.github/ISSUE_TEMPLATE/config.ymlwith contact links to:- MkDocs Ultralytics Plugin README
- PyPI package
- Ultralytics Community Forum
- Ultralytics Discord
- Encourages users to search existing issues/discussions before opening new ones and optionally volunteer to submit PRs.
- Adds structured templates for:
🎯 Purpose & Impact
-
⚡ Performance & scalability
- By moving from “git per file” to a single cached git pass, large documentation sites avoid hundreds or thousands of repeated git calls.
- Builds and postprocessing runs become noticeably faster and more stable, especially on CI or large repos.
-
🧾 Richer and more consistent metadata
- Creation and last-modified dates, plus author information, are now computed consistently from a shared git log map.
- JSON-LD and SEO-related features that depend on dates/authors become more reliable and easier to reason about.
-
🧹 Cleaner architecture & easier maintenance
- All git interactions are centralized (
build_git_map+git_data), reducing complexity and the risk of inconsistent behavior between plugin mode and postprocess mode. - Utilities like
get_github_usernames_from_fileare now focused purely on mapping emails to GitHub users, not running git commands.
- All git interactions are centralized (
-
👀 Better user experience during builds
- Optional progress bars and structured logging make it easier to see what’s happening during postprocessing, especially on large sites.
- Clearer error messages for read/write failures help diagnose broken HTML files or permission issues.
-
🤝 Smoother support and community workflows
- Issue templates guide users to provide essential details (environment, minimal repro, motivation, context), which speeds up triage and responses.
- Direct links to docs, PyPI, and community channels help users self-serve or get the right kind of help faster.
Overall, v0.2.2 is a performance and tooling upgrade: faster builds, cleaner git metadata handling, and better collaboration around issues and feature requests. 🎉
What's Changed
- Issue templates by @glenn-jocher in #171
- Single
gitcall for authors and dates by @glenn-jocher in #172
Full Changelog: v0.2.1...v0.2.2