Implement head partial to include a <meta/> redirect when desired

This commit is contained in:
sixtus 2022-10-09 20:35:09 +02:00
parent 8e18468f1f
commit 6ebe809abb
1 changed files with 9 additions and 0 deletions

View File

@ -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 }}
<meta http-equiv="refresh" content="{{ $delay }}; url={{ $url }}">
{{- end }}