hugo-theme/layouts/shortcodes/download.html

13 lines
327 B
HTML
Raw Normal View History

2024-03-02 03:17:22 +00:00
{{ $file:= .Get "file" }}
{{ if not (resources.Get $file) }}
{{ errorf "Error: 'file' is a required parameter." }}
{{ end }}
{{- with .Get "message" -}}
<p>{{- . -}}</p>
{{- end -}}
{{- with resources.Get $file -}}
<a class="button" href="{{ .RelPermalink }}" download>Download {{ path.Ext $file }}</a>
{{- end -}}