Skip to content

v0.2.2 - Single `git` call for authors and dates (#172)

Choose a tag to compare

@github-actions github-actions released this 22 Nov 14:28
· 19 commits to main since this release
dcbd0d4

🌟 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_config to compute git metadata (repo URL + git log map) once at build time.
    • Introduces build_git_map in processor.py to gather creation/modified dates and author emails for all Markdown files using a single git log command.
    • Updates get_git_info to read from cached git_data instead of running git log/git blame per file.
    • Passes git_data and repo_url into process_html and process_html_file, ensuring all HTML processing can reuse the same metadata.
  • ⚙️ Faster postprocessing with progress feedback (PR #172)

    • postprocess_site now builds a shared git map for all source files before processing HTML.
    • Integrates optional TQDM progress bars (when ultralytics is installed) to show per-file progress during postprocessing.
    • Adds a pluggable log callback to process_html_file so 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_file now uses precomputed email counts (from build_git_map) instead of running git commands itself.
    • Accepts an optional repo_url to 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.yml with 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.

🎯 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_file are now focused purely on mapping emails to GitHub users, not running git commands.
  • 👀 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

Full Changelog: v0.2.1...v0.2.2