uci-hugo-landingpage/layouts/shortcodes/avatar.html
2017-04-07 17:02:17 -07:00

9 lines
414 B
HTML

{{ $numOfParams := ( len .Params ) }}
{{ $avatar := "avatar.jpg" }}
{{ if eq $numOfParams 1 }}{{ $avatar := .Get 1 }}{{ end }}
<div class="box box--avatar">
{{ 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>