From 548ed3353fc6304ed9157f5c6d958338cba01b52 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Wed, 6 Nov 2024 21:59:43 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=93=9D=20Add=20the=20build=20date=20t?= =?UTF-8?q?o=20the=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: From 60162a7b91996ccf25647ac9b0b7ea723988d6a8 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Tue, 12 Nov 2024 12:46:26 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=92=9A=20Fix=20CORS=20error=20when=20?= =?UTF-8?q?building=20PDF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer load Mathjax JS from Unpkg but Cloudflare. This fixes #97 and loads a minified JS which is lightweight. --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 1c6b4706..6edce986 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -94,7 +94,7 @@ extra_css: extra_javascript: - assets/javascripts/mathjax.js - assets/javascripts/mkdocs-exporter.js - - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js + - https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js - https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.1/mermaid.min.js # Customizations From ab35134bdede34f1bdb9075ba2d8838c9783c74e Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Wed, 6 Nov 2024 22:00:04 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=92=9A=20Re-enable=20PDF=20Generation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c445005e..bcc796df 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,7 +57,7 @@ jobs: run: playwright install --with-deps chromium - name: Build Website - run: mkdocs build + run: MKDOCS_EXPORTER_PDF=true mkdocs build - name: Push Website to gh-pages Branch uses: JamesIves/github-pages-deploy-action@v4 From e3c66c9ff73861828bd605f1b5ec7b8df0113335 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Wed, 20 Nov 2024 15:08:37 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20version=20number?= =?UTF-8?q?=20in=20PDF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 6edce986..8daf12ed 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -109,7 +109,7 @@ extra: - icon: fontawesome/brands/facebook link: https://www.facebook.com/groups/diytrio name: Trio on Facebook - version: 0.2.1 + version: 0.2.2 markdown_extensions: - admonition