theme: break build if minimum Hugo version is not matched #719

This commit is contained in:
Sören Weber 2023-11-12 23:44:36 +01:00
parent f1a98e098f
commit b91fb6e9e7
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -5,6 +5,12 @@
{{- if eq $outputFormat "searchpage" }}
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
{{- end }}
{{- if eq . .Site.Sites.First.Home }}
{{- $minHugoVersion := "0.95.0" }}
{{- if lt hugo.Version $minHugoVersion }}
{{- errorf "The Relearn theme requires Hugo %s or later" $minHugoVersion }}
{{- end }}
{{- end }}
<html lang="{{ .Page.Language | default "en" }}" dir="{{ T "Reading-direction" | default "ltr" }}">
<head>
{{- partial "meta.html" . }}