From f430f0730b749da64b63198e9ce91d6cc6427867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Wed, 27 Jul 2022 11:21:03 +0800 Subject: [PATCH] :wrench: Add Hugo version judge logic to avoid the lower version building. Closed #21 --- layouts/partials/init.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/partials/init.html b/layouts/partials/init.html index 723603f..5ceb18a 100644 --- a/layouts/partials/init.html +++ b/layouts/partials/init.html @@ -5,6 +5,12 @@ {{ errorf "Because that use SCSS framework in Hugo NexT, Please download Hugo extended version on offical site: https://github.com/gohugoio/hugo/releases" }} {{ end }} +{{ $version := int (index (split hugo.Version ".") 1) }} +{{ if lt $version 89 }} +{{ warnf "当前 Hugo 版本小于 0.89.0,请到官方地址下载 Hugo 最新版本:https://github.com/gohugoio/hugo/releases" }} +{{ errorf "Current Hugo version is less then 0.89.0, Please download Hugo latest version on offical site: https://github.com/gohugoio/hugo/releases" }} +{{ end }} + {{ $globalVars := newScratch }} {{ $globalVars.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) }}