mirror of
https://github.com/Crocmagnon/blog.git
synced 2024-11-21 23:38:03 +01:00
fix img alt
This commit is contained in:
parent
9dd00a5f20
commit
e77574b505
1 changed files with 2 additions and 2 deletions
|
@ -1,12 +1,12 @@
|
||||||
{{ $src := .Get "src" }}
|
{{ $src := .Get "src" }}
|
||||||
{{ $origImage := .Page.Resources.GetMatch $src }}
|
{{ $origImage := .Page.Resources.GetMatch $src }}
|
||||||
{{ if eq $origImage.MediaType.SubType "svg" }}
|
{{ if eq $origImage.MediaType.SubType "svg" }}
|
||||||
<img src="{{ $origImage.RelPermalink }}" alt='.Get "alt"'>
|
<img src="{{ $origImage.RelPermalink }}" alt='{{ .Get "alt" }}'>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $resizeAdd := .Get "resizeAdd" | default "" }}
|
{{ $resizeAdd := .Get "resizeAdd" | default "" }}
|
||||||
{{ $resize := printf "%s%s" (.Get "resize" | default "720x webp Lanczos ") $resizeAdd }}
|
{{ $resize := printf "%s%s" (.Get "resize" | default "720x webp Lanczos ") $resizeAdd }}
|
||||||
{{ $image := $origImage.Resize $resize }}
|
{{ $image := $origImage.Resize $resize }}
|
||||||
<a href="{{ $origImage.RelPermalink }}">
|
<a href="{{ $origImage.RelPermalink }}">
|
||||||
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt='.Get "alt"'>
|
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt='{{ .Get "alt" }}'>
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue