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

10 lines
414 B
HTML
Raw Normal View History

2017-04-07 17:02:17 -07:00
{{ $numOfParams := ( len .Params ) }}
{{ $avatar := "avatar.jpg" }}
{{ if eq $numOfParams 1 }}{{ $avatar := .Get 1 }}{{ end }}
<div class="box box--avatar">
2017-04-07 17:02:17 -07:00
{{ if eq $numOfParams 2 }}<a href="{{.Get 1 }}">{{ end }}
{{ $path := "/images/" }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
<img class="avatar" src="{{ $path }}{{ $avatar }}"/>
{{ if eq $numOfParams 2 }}</a>{{ end }}
</div>