diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-04-23 14:46:35 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-23 14:46:35 +0300 |
| commit | fed793f8a0daae064dd58d52ed2396a98646d567 (patch) | |
| tree | 2861d1d3d54415511c68a57a3d372de48c7b4e80 /docs/conf.py | |
| parent | cac7b484e89354fae0054c8f33c4dc5139df42fa (diff) | |
| parent | abc3e9d38f8ce56fd73cd2007b96152fcbd083a2 (diff) | |
| download | vyos-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.py | 12 |
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) |
