uci-hugo-landingpage/layouts/shortcodes/avatar.html

14 lines
459 B
HTML

{{ $path := "/images/" }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
{{ if .IsNamedParams }}
<div class="box box--avatar">
{{ with .Get "url" }}<a href="{{.}}">{{ end }}
<img class="avatar" src="{{ $path }}{{ .Get "img" }}"/>
{{ with .Get "url" }}</a>{{ end }}
</div>
{{ else }}
{{ $avatar := ( .Get 0 | default "avatar.jpg" ) }}
<div class="box box--avatar">
<img class="avatar" src="{{ $path }}{{ $avatar }}"/>
</div>
{{ end }}