Skip to content

Commit

Permalink
feat: add svg author image support (#214)
Browse files Browse the repository at this point in the history
Co-authored-by: Dor Munis <[email protected]>
  • Loading branch information
TheSantacloud and TheSantacloud authored Sep 26, 2024
1 parent c95d246 commit 20c3fe4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/partials/bio.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
{{ $image := resources.Get $avatar_img }}
<div class="author">
{{ with $image }}
{{ if eq .MediaType.SubType "svg" }}
<svg width="25em" height="25em" xmlns="http://www.w3.org/2000/svg">
<image width="25em" height="25em" href="{{ $image.RelPermalink }}" />
</svg>
{{ else }}
{{ $image := $image.Fill "100x100 webp" }}
<img class="author-avatar" src="{{ $image.RelPermalink }}" alt="{{ $avatar_img_alt }}" width="{{ .Width }}"
height="{{ .Height }}" />
{{ end }}
{{ end }}
<h2 class="author-name">{{ .Site.Params.author.intro }}</h2>
<p class="author-bio">{{ .Site.Params.author.description }}</p>
</div>

0 comments on commit 20c3fe4

Please sign in to comment.