uci-shortcodes/layouts/shortcodes/file.html

5 lines
302 B
HTML

{{ $path := "/files/" }}
{{ with $.Site.Params.filespath }} {{ $path := ( . ) }}{{ end }}
{{ $numOfParams := ( len .Params ) }}
{{ if eq $numOfParams 1 }} <a href="{{ $path }}{{ .Get 0 }}">{{ .Get 0 }}</a>{{ end }}
{{ if eq $numOfParams 2 }} <a href="{{ $path }}{{ .Get 0 }}">{{ .Get 1 }}</a> {{ end }}