summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-04-23 14:46:35 +0300
committerGitHub <noreply@github.com>2026-04-23 14:46:35 +0300
commitfed793f8a0daae064dd58d52ed2396a98646d567 (patch)
tree2861d1d3d54415511c68a57a3d372de48c7b4e80 /docs/conf.py
parentcac7b484e89354fae0054c8f33c4dc5139df42fa (diff)
parentabc3e9d38f8ce56fd73cd2007b96152fcbd083a2 (diff)
downloadvyos-documentation-fed793f8a0daae064dd58d52ed2396a98646d567.tar.gz
vyos-documentation-fed793f8a0daae064dd58d52ed2396a98646d567.zip
Merge pull request #1841 from vyos/yuriy/convert-images-to-webp
perf: convert all images to WebP with PDF fallback
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 4d8f9f16..1c1014e0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -134,7 +134,7 @@ llms_txt_file = False
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
-html_logo = '_static/images/vyos-logo.png'
+html_logo = '_static/images/vyos-logo.webp'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
@@ -209,5 +209,13 @@ texinfo_documents = [
]
+def _prefer_webp(app):
+ """Prepend WebP to supported image types for HTML builders."""
+ if app.builder.name in ('html', 'dirhtml', 'readthedocs'):
+ types = app.builder.supported_image_types
+ if 'image/webp' not in types:
+ app.builder.supported_image_types = ['image/webp'] + types
+
+
def setup(app):
- pass \ No newline at end of file
+ app.connect('builder-inited', _prefer_webp)