Merge branch 'develop'
This commit is contained in:
commit
000779c848
7 changed files with 117 additions and 6 deletions
16
layouts/shortcodes/img.html
Normal file
16
layouts/shortcodes/img.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!-- prettier-ignore -->
|
||||
{{ $src := .Get "src" }}
|
||||
{{ $alt := .Get "alt" | default "" }}
|
||||
{{ $width := .Get "width" | default "800x" }}
|
||||
|
||||
<figure class="blog-img-container">
|
||||
{{ with .Page.Resources.GetMatch $src }}
|
||||
{{ $resized := .Resize $width }}
|
||||
<img src="{{ $resized.RelPermalink }}" alt="{{ $alt }}" loading="lazy" class="blog-img" />
|
||||
{{ else }}
|
||||
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" class="blog-img" />
|
||||
{{ end }}
|
||||
{{ if $alt }}
|
||||
<figcaption class="blog-img-caption">{{ $alt }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
Loading…
Add table
Add a link
Reference in a new issue