From 2c50daed6f624ea45389168753cec292f64b928c Mon Sep 17 00:00:00 2001 From: Marius <24592972+gilbN@users.noreply.github.com> Date: Sat, 25 Oct 2025 13:35:47 +0200 Subject: [PATCH] Add file_exists macro to jinja context. Use file_exists to only render screenshots and logo iif they exist. Add __pycache__ to gitignore. --- .gitignore | 3 ++- docs/themes/screenshots.md | 2 ++ docs/themes/title.md | 3 ++- main.py | 9 +++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 main.py diff --git a/.gitignore b/.gitignore index c52ef795..25da9d5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ site venv* -.vscode \ No newline at end of file +.vscode +__pycache__/ \ No newline at end of file diff --git a/docs/themes/screenshots.md b/docs/themes/screenshots.md index f0d79140..48521f64 100644 --- a/docs/themes/screenshots.md +++ b/docs/themes/screenshots.md @@ -2,7 +2,9 @@ {% set themes = config.extra.themes %} {% for theme in themes %} +{% if file_exists("/docs/site_assets/" ~ page.file.name ~ "/" ~ theme ~ ".png") %}
{{ theme.capitalize() }} Theme