Skip to content

Commit

Permalink
fix(image): use width only
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Jan 6, 2025
1 parent db2ca11 commit ef5ed93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ figure {
img {
display: block;
max-width: 100%;
height: auto;
-ms-interpolation-mode: bicubic;
image-rendering: optimizeQuality;
margin: 0 auto;
Expand Down
2 changes: 1 addition & 1 deletion templates/shortcodes/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{%- if link %}
<a href={{ link | safe }}>
{%- endif %}
<img class="align-center page-image" src="{% if src is matching("^http[s]?://") %}{{ image | safe }}{% else %}{{ image ~ "?v=" ~ get_hash(path=image, sha_type=512, base64=false) | safe }}{% endif %}"{% if height or width %}{% if height %} height="{{ height }}"{% endif %}{% if width %} width="{{ width }}"{% endif %}{% elif meta %} width="{{ meta.width }}" height="{{ meta.height }}"{% endif %}{% if alt %} alt="{{ alt | safe }}"{% endif %}/>
<img class="align-center page-image" src="{% if src is matching("^http[s]?://") %}{{ image | safe }}{% else %}{{ image ~ "?v=" ~ get_hash(path=image, sha_type=512, base64=false) | safe }}{% endif %}"{% if width %} width="{{ width }}"{% elif meta %} width="{{ meta.width }}" height="{{ meta.height }}"{% endif %}{% if alt %} alt="{{ alt | safe }}"{% endif %}/>
{%- if link %}</a>{% endif %}
{%- if caption %}<figcaption>{{ caption | safe }}</figcaption>{% endif %}
</figure>

0 comments on commit ef5ed93

Please sign in to comment.