Skip to content

Commit

Permalink
📝 Add the build date to the PDF front cover
Browse files Browse the repository at this point in the history
  • Loading branch information
ebouchut committed Nov 12, 2024
1 parent ad9b1c0 commit 548ed33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/assets/templates/covers/front.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
<section>
<div class="brand">{{ config.site_name }}</div>
<div class="version">
version {{ version }}
Version: {{ version }}
<br />
Date: {{ build_date }}
<p>
Download the latest version on: https://docs.diy-trio.org
</p>
Expand Down
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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')
3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ theme:

plugins:
- open-in-new-tab
- macros:
include_dir: .
- macros
- exporter:
formats:
pdf:
Expand Down

0 comments on commit 548ed33

Please sign in to comment.