Add alt text to my image in the about page and make it scale with content width

This commit is contained in:
Eryn Wells 2022-10-14 14:29:25 -07:00
parent 2cd2b89be4
commit bb4b2cd4e9
3 changed files with 21 additions and 6 deletions

View file

@ -1,5 +1,12 @@
{{ $img := (.Page.Resources.GetMatch (.Get "name")) }}
{{ $classes := .Get "class" }}
{{ $width := .Get "width" }}
{{ $resized_img := $img.Resize (printf "%dx%d" $width $width) }}
<img class="circular {{ $classes }}" src="{{ $img.RelPermalink }}" width="{{ $width }}" height="{{ $width }}">
{{- $img := (.Page.Resources.GetMatch (.Get "name")) -}}
{{- $id := .Get "id" -}}
{{- $classes := .Get "class" -}}
{{- $alt := .Get "alt" -}}
{{- $width := .Get "width" -}}
{{- $resized_img := $img.Resize (printf "%dx%d" $width $width) -}}
<img
{{ with $id }}id="{{ . }}"{{ end }}
class="circular{{ with $classes }} {{ . }}{{ end }}"
src="{{ $img.RelPermalink }}"
{{ with $alt }}alt="{{ . }}"{{ end }}
width="{{ $width }}" height="{{ $width }}">