change to hugo-blog-awesome theme
This commit is contained in:
parent
113e3650f1
commit
15b6142a8e
131 changed files with 5895 additions and 124 deletions
25
themes/hugo-blog-awesome/layouts/partials/bio.html
Normal file
25
themes/hugo-blog-awesome/layouts/partials/bio.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
{{ $avatar_img := .Site.Params.author.avatar }}
|
||||
{{ $avatar_img_alt := .Site.Params.author.name }}
|
||||
{{ $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 }}
|
||||
{{ $image1x := $image.Fill "70x70 center webp" }}
|
||||
{{ $image2x := $image.Fill "140x140 center webp" }}
|
||||
{{ $image3x := $image.Fill "210x210 center webp" }}
|
||||
<img
|
||||
class="author-avatar"
|
||||
src="{{ $image1x.RelPermalink }}"
|
||||
srcset="{{ $image2x.RelPermalink }} 2x, {{ $image3x.RelPermalink }} 3x"
|
||||
alt="{{ $avatar_img_alt }}"
|
||||
width="{{ $image1x.Width }}"
|
||||
height="{{ $image1x.Height }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h2 class="author-name">{{ .Site.Params.author.intro }}</h2>
|
||||
<p class="author-bio">{{ .Site.Params.author.description }}</p>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue