Skip to content

Commit

Permalink
Provide width and height for images
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Sep 11, 2023
1 parent 1e90d7f commit 30d506a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
{{ if eq .MediaType.SubType "svg" }}
src="{{ .RelPermalink }}"
{{ else }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ if lt .Width 660 }}
src="{{ .RelPermalink }}"
{{ else }}
Expand Down
2 changes: 2 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ if eq .MediaType.SubType "svg" }}
src="{{ .RelPermalink }}"
{{ else }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ if lt .Width 660 }}
src="{{ .RelPermalink }}"
{{ else }}
Expand Down

0 comments on commit 30d506a

Please sign in to comment.