{"id":5321,"library":"mkdocs-git-revision-date-plugin","title":"MkDocs Git Revision Date Plugin","description":"mkdocs-git-revision-date-plugin is an MkDocs plugin that automatically retrieves and displays the last Git revision date for each Markdown page in an MkDocs site. It provides the revision date in ISO (YYYY-mm-dd) format for use in page templates or directly within Markdown files. As of version 0.3.2, it is considered to be in maintenance mode, with more feature-rich development continuing in the `mkdocs-git-revision-date-localized-plugin` fork.","status":"active","version":"0.3.2","language":"en","source_language":"en","source_url":"https://github.com/zhaoterryy/mkdocs-git-revision-date-plugin/","tags":["mkdocs","plugin","git","revision date","documentation"],"install":[{"cmd":"pip install mkdocs-git-revision-date-plugin","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core dependency for any MkDocs plugin.","package":"mkdocs","optional":false},{"reason":"Required for interacting with Git to retrieve revision dates.","package":"GitPython","optional":false}],"imports":[],"quickstart":{"code":"plugins:\n  - search\n  - git-revision-date\n\n# Example usage in a Markdown file:\n# Page last revised on: {{ git_revision_date }}\n\n# Example usage in an MkDocs template (e.g., in a custom theme):\n# {% if page.meta.revision_date %}\n# <small>Last updated {{ page.meta.revision_date }}</small>\n# {% endif %}","lang":"yaml","description":"Add the plugin to your `mkdocs.yml` file under the `plugins` section. The revision date can then be accessed in Markdown files using the `{{ git_revision_date }}` Jinja2 variable, or in theme templates via `page.meta.revision_date`. Remember to include the `search` plugin explicitly if you define any plugins."},"warnings":[{"fix":"Consider migrating to `mkdocs-git-revision-date-localized-plugin` for enhanced functionality. Install it with `pip install mkdocs-git-revision-date-localized-plugin` and update your `mkdocs.yml` to `plugins: - git-revision-date-localized`.","message":"This plugin provides only ISO formatted dates (YYYY-mm-dd) and lacks localization features. For more advanced date formatting, localization, or to display page creation dates, it is highly recommended to use the `mkdocs-git-revision-date-localized-plugin` fork, which is more actively maintained and feature-rich.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Adjust your CI/CD workflow to ensure a full Git history clone. Example for GitHub Actions: `actions/checkout@v4 with: fetch-depth: 0`.","message":"In CI/CD environments (e.g., GitHub Actions, GitLab CI), Git repositories often perform shallow clones by default. To correctly retrieve historical revision dates for all files, you must configure your CI/CD pipeline to fetch the full Git history (e.g., set `fetch-depth: 0` for GitHub Actions or `GIT_DEPTH: 0` for GitLab CI).","severity":"breaking","affected_versions":"All versions"},{"fix":"Monitor official MkDocs documentation and the Material for MkDocs blog for migration strategies and potential alternatives when MkDocs 2.0 is released. You may need to pin your `mkdocs` dependency to `<2` to avoid automatic upgrades.","message":"Upcoming versions of MkDocs (specifically MkDocs 2.0) are anticipated to introduce significant backward-incompatible changes. The plugin system is expected to be removed, meaning this plugin (and all other MkDocs plugins) will likely cease to function with MkDocs 2.0.","severity":"breaking","affected_versions":"Future MkDocs 2.0"},{"fix":"Ensure your `plugins` section in `mkdocs.yml` includes `search`, e.g., `plugins: - search - git-revision-date`.","message":"If you define any plugins in your `mkdocs.yml` (including `git-revision-date`), MkDocs' default `search` plugin is no longer automatically enabled. You must explicitly add `search` to your `plugins` list if you want to retain search functionality.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}