Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add SVG demo usage and update rendering (fixes #602)
This PR adds SVG images to the Bakerydemo content and updates the rendering template so they display correctly.
Context
In #602 it was noted that when implementing SVG support earlier, the demo site ended up without any SVG images in its content. As a result, Bakerydemo could not be used to properly test or demonstrate Wagtail’s SVG support.
The issue requested adding one or two SVG images to the demo site for testing purposes.
More recently in #630, SVG files were added to the repository. The remaining step mentioned by @thibaudcolas was to actually use those images within the site content and ensure rendering works correctly.
Changes
1. Add SVG demo images to fixtures
Adds two SVG images to the demo fixtures:
chef_illustration.svgsliced_bread_loaf.svg2. Use an SVG image in demo content
Adds the sliced bread illustration to an existing blog page via the
image_blockso the demo site contains a visible SVG example.3. Update template rendering for SVG
The
captioned_image_blocktemplate previously rendered all images with:This assumes raster images and performs format conversion, which is not supported for SVG images. When an SVG is used this causes:
The template now detects SVG images and renders them using:
while keeping the existing responsive
picturepipeline for raster images.Result