From 548ed3353fc6304ed9157f5c6d958338cba01b52 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Wed, 6 Nov 2024 21:59:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20the=20build=20date=20to=20?= =?UTF-8?q?the=20PDF=20front=20cover?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/assets/templates/covers/front.html.j2 | 4 +++- main.py | 5 +++++ mkdocs.yml | 3 +-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 main.py diff --git a/docs/assets/templates/covers/front.html.j2 b/docs/assets/templates/covers/front.html.j2 index 1298293c..cfde1972 100644 --- a/docs/assets/templates/covers/front.html.j2 +++ b/docs/assets/templates/covers/front.html.j2 @@ -84,7 +84,9 @@
{{ config.site_name }}
- version {{ version }} + Version: {{ version }} +
+ Date: {{ build_date }}

Download the latest version on: https://docs.diy-trio.org

diff --git a/main.py b/main.py new file mode 100644 index 00000000..0c280edb --- /dev/null +++ b/main.py @@ -0,0 +1,5 @@ +from datetime import datetime + +def define_env(env): + # Define a macro that returns the current build date in UTC + env.variables['build_date'] = datetime.utcnow().strftime('%B %d, %Y') \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index b86929f9..1c6b4706 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,8 +65,7 @@ theme: plugins: - open-in-new-tab - - macros: - include_dir: . + - macros - exporter: formats: pdf: