|
@@ -4,14 +4,16 @@ Summary
|
|
This plug-in:
|
|
This plug-in:
|
|
|
|
|
|
- Adds a `style="width: ???px;"` attribute to any `<img>` tags in the content, by checking
|
|
- Adds a `style="width: ???px;"` attribute to any `<img>` tags in the content, by checking
|
|
-the dimensions of the image file and adding the appropriate style="width: ???px;" to the `<img>` tag.
|
|
|
|
|
|
+the dimensions of the image file and adding the appropriate `style="width: ???px; height: auto;"` to the `<img>` tag.
|
|
- Also finds any `div class="figures"` tags in the content, that contain images and adds the same style to them too.
|
|
- Also finds any `div class="figures"` tags in the content, that contain images and adds the same style to them too.
|
|
|
|
+- If RESPONSIVE_IMAGES setting is true, it adds `style="max-width: 100%; height: auto;"` instead.
|
|
|
|
+- Corrects Alt text: If an img alt attribute = the image filename, it sets it to ""
|
|
|
|
|
|
|
|
|
|
Assuming that the image is 250px wide, it turns output like this:
|
|
Assuming that the image is 250px wide, it turns output like this:
|
|
|
|
|
|
- <div class="figure" style="width: 250px;">
|
|
|
|
- <img style="width: 250px;" alt="map to buried treasure" src="/static/images/image.jpg" />
|
|
|
|
|
|
+ <div class="figure">
|
|
|
|
+ <img alt="/static/images/image.jpg" src="/static/images/image.jpg" />
|
|
<p class="caption">
|
|
<p class="caption">
|
|
This is the caption of the figure.
|
|
This is the caption of the figure.
|
|
</p>
|
|
</p>
|
|
@@ -23,8 +25,8 @@ Assuming that the image is 250px wide, it turns output like this:
|
|
|
|
|
|
into output like this:
|
|
into output like this:
|
|
|
|
|
|
- <div class="figure" style="width: 250px;">
|
|
|
|
- <img style="width: 250px;" alt="map to buried treasure" src="/static/images/image.jpg" />
|
|
|
|
|
|
+ <div class="figure" style="width: 250px; height: auto;">
|
|
|
|
+ <img style="width: 250px; height: auto;" alt="" src="/static/images/image.jpg" />
|
|
<p class="caption">
|
|
<p class="caption">
|
|
This is the caption of the figure.
|
|
This is the caption of the figure.
|
|
</p>
|
|
</p>
|
|
@@ -34,3 +36,15 @@ into output like this:
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+or this, if RESPONSIVE_IMAGES = True:
|
|
|
|
+
|
|
|
|
+ <div class="figure" style="max-width: 100%; height: auto;">
|
|
|
|
+ <img style="max-width: 100%; height: auto;" alt="" src="/static/images/image.jpg" />
|
|
|
|
+ <p class="caption">
|
|
|
|
+ This is the caption of the figure.
|
|
|
|
+ </p>
|
|
|
|
+ <div class="legend">
|
|
|
|
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
|
|
|
+ tempor incididunt ut labore et dolore magna aliqua.
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|