made download shortcode

This commit is contained in:
Jakub 2024-03-01 22:17:22 -05:00
parent be6204aa1e
commit 1db3d7cf24

View File

@ -0,0 +1,12 @@
{{ $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 -}}