From 8ebb21dbc500c18e2abefd20f0bdd56316dfbedd Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Sat, 12 Jun 2021 17:10:00 +0200 Subject: [PATCH] add shortcodes for pdffile and slides Signed-off-by: Toshaan Bharvani --- .../layouts/shortcodes/pdffile.html | 1 + .../layouts/shortcodes/slides.html | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 themes/openpowerfoundation/layouts/shortcodes/pdffile.html create mode 100644 themes/openpowerfoundation/layouts/shortcodes/slides.html diff --git a/themes/openpowerfoundation/layouts/shortcodes/pdffile.html b/themes/openpowerfoundation/layouts/shortcodes/pdffile.html new file mode 100644 index 0000000..ec4c813 --- /dev/null +++ b/themes/openpowerfoundation/layouts/shortcodes/pdffile.html @@ -0,0 +1 @@ +  diff --git a/themes/openpowerfoundation/layouts/shortcodes/slides.html b/themes/openpowerfoundation/layouts/shortcodes/slides.html new file mode 100644 index 0000000..d6217d4 --- /dev/null +++ b/themes/openpowerfoundation/layouts/shortcodes/slides.html @@ -0,0 +1,25 @@ +{{ $slidesurl := .Get "url" }} +{{ $title := .Get "title" }} + +{{ $slidesprefix := substr $slidesurl 0 5 }} +{{ $slidessuffix := split $slidesurl "." }} +{{ $slidestypesize := int (sub (len $slidessuffix) 1) }} +{{ $slidestype := index $slidessuffix $slidestypesize }} +{{ if eq $slidesprefix "https" }} + {{ $slidesurl = $slidesurl }} +{{ else }} + {{ $slidesurl = printf "%s/%s" "https://assets.gsebelux.eu" $slidesurl }} +{{ end }} + +
+

{{ $title }}

+ {{ if eq $slidestype "pdf" }} + + +

This browser does not support PDFs. Please download the PDF to view it.

+ +
+
+ {{ end }} + Download +