From 1db3d7cf24ca2fb1dcae0053ce5cd4e735ff24a7 Mon Sep 17 00:00:00 2001 From: Jakub Date: Fri, 1 Mar 2024 22:17:22 -0500 Subject: [PATCH] made download shortcode --- layouts/shortcodes/download.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 layouts/shortcodes/download.html diff --git a/layouts/shortcodes/download.html b/layouts/shortcodes/download.html new file mode 100644 index 0000000..5ab88dd --- /dev/null +++ b/layouts/shortcodes/download.html @@ -0,0 +1,12 @@ +{{ $file:= .Get "file" }} +{{ if not (resources.Get $file) }} + {{ errorf "Error: 'file' is a required parameter." }} +{{ end }} + + {{- with .Get "message" -}} +

{{- . -}}

+ {{- end -}} + + {{- with resources.Get $file -}} + Download {{ path.Ext $file }} + {{- end -}}