made download shortcode
This commit is contained in:
parent
be6204aa1e
commit
1db3d7cf24
12
layouts/shortcodes/download.html
Normal file
12
layouts/shortcodes/download.html
Normal 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 -}}
|
Loading…
Reference in New Issue
Block a user