diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-04-15 12:46:31 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-04-15 12:46:31 +0300 |
| commit | 296b2d226b547ba2e5359cbf40f9d3f76e5fcd95 (patch) | |
| tree | 08e15db0369d82000c016851162f788c1a22a0c7 /docs/conf.py | |
| parent | 1802518c053bde050074d85a137ffe672ec99e53 (diff) | |
| download | vyos-documentation-296b2d226b547ba2e5359cbf40f9d3f76e5fcd95.tar.gz vyos-documentation-296b2d226b547ba2e5359cbf40f9d3f76e5fcd95.zip | |
fix: prepend WebP to existing supported_image_types instead of replacing
Avoids dropping types that Sphinx or themes may add in future versions.
Deduplicates if WebP is already present.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'docs/conf.py')
| -rw-r--r-- | docs/conf.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/docs/conf.py b/docs/conf.py index 7f302ceb..ec1827ca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -210,15 +210,11 @@ texinfo_documents = [ def _prefer_webp(app): - """Add WebP to front of supported types for HTML/dirhtml builders only.""" + """Prepend WebP to supported image types for HTML builders.""" if app.builder.name in ('html', 'dirhtml', 'readthedocs'): - app.builder.supported_image_types = [ - 'image/webp', - 'image/svg+xml', - 'image/png', - 'image/gif', - 'image/jpeg', - ] + types = app.builder.supported_image_types + if 'image/webp' not in types: + app.builder.supported_image_types = ['image/webp'] + types def setup(app): |
