Skip to content

Commit

Permalink
fix: template failure in bio.html when avatar is not found/defined (#15)
Browse files Browse the repository at this point in the history
Merge pull request #15 from MikeMoolenaar/dev
  • Loading branch information
MikeMoolenaar authored Mar 20, 2023
1 parent 6a5b20e commit 295c8a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/bio.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{ $avatar_img := .Site.Params.author.avatar }}
{{ $avatar_img_alt := .Site.Params.author.name }}
{{ $image := resources.Get $avatar_img }}
{{ $image := $image.Fill "100x100 webp" }}
<div class="author">
{{ with $image }}
{{ $image := $image.Fill "100x100 webp" }}
<img class="author-avatar"
src="{{ $image.RelPermalink }}"
alt="{{ $avatar_img_alt }}" width="{{ .Width }}" height="{{ .Height }}" />
{{ end }}
<h2 class="author-name">{{ .Site.Params.author.intro }}</h2>
<p class="author-bio">{{ .Site.Params.author.description }}</p>
</div>
</div>

0 comments on commit 295c8a1

Please sign in to comment.