From 6ebe809abb9072d41e86d3d12cc711cead81b53f Mon Sep 17 00:00:00 2001 From: Frieder Griesshammer Date: Sun, 9 Oct 2022 20:35:09 +0200 Subject: [PATCH] Implement head partial to include a redirect when desired --- layouts/partials/head.html | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 layouts/partials/head.html diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..d95fed0 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,9 @@ +{{- /* handle redirects */}} +{{- with index (default dict (index $.Page.Params "values")) "redirect" }} +{{- $delay := default 0 (index . "delay") }} +{{- $url := index . "url" }} +{{- if not $url }} +{{- errorf "missing, empty or null value at 'values.redirect.url': %s" .Position }} +{{- end }} + +{{- end }}