From d55a930b4e2af17736f0120d5785b63958d16936 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Mon, 11 Nov 2024 13:24:35 -0800 Subject: [PATCH] Use mkdocs plugin to put last update time on pages The git-revision-date-localized plugin will automatically add the last update date to each markdown page based on the date of the last change in git to the file. Signed-off-by: Eric Brown --- docs/getting-started.md | 3 --- docs/index.md | 2 -- docs/requirements.txt | 5 +++-- docs/rules.md | 2 -- mkdocs.yml | 1 + 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index ae993a31..154ec218 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -81,6 +81,3 @@ repos: ``` Then run `pre-commit install` and you're ready to go. - - -_Last updated on {{ git.date.strftime("%b %d, %Y") }}_ diff --git a/docs/index.md b/docs/index.md index 721b6a16..bb9c34f1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -40,5 +40,3 @@ vulnerabilities. [:octicons-arrow-right-24: License](https://github.com/securesauce/precli/blob/main/LICENSE) - -_Last updated on {{ git.date.strftime("%b %d, %Y") }}_ \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 37f93528..22f21219 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,7 @@ # Copyright 2024 Secure Sauce LLC # SPDX-License-Identifier: BUSL-1.1 mkdocs -mkdocstrings[python] -mkdocs-material mkdocs-macros-plugin +mkdocs-material +mkdocs-git-revision-date-localized-plugin +mkdocstrings[python] diff --git a/docs/rules.md b/docs/rules.md index 02e4ee64..a5fac1c0 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -70,5 +70,3 @@ | PY044 | [telnetlib — no timeout](rules/python/stdlib/telnetlib-no-timeout.md) | Synchronous Access of `Telnet` without Timeout | | PY045 | [ftplib — no timeout](rules/python/stdlib/ftplib-no-timeout.md) | Synchronous Access of `FTP` without Timeout | | PY046 | [ssl — no timeout](rules/python/stdlib/ssl-no-timeout.md) | Synchronous Access of `ssl` without Timeout | - -_Last updated on {{ git.date.strftime("%b %d, %Y") }}_ diff --git a/mkdocs.yml b/mkdocs.yml index 222c695a..0227fb5b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,6 +22,7 @@ plugins: - mkdocstrings - search - macros + - git-revision-date-localized nav: - Home: index.md