{{- $version := "0.2.X" -}} {{- /* LoveIt theme version detection */ -}} {{- if not .Site.Params.version -}} {{- errorf "\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration \n你还没有正确配置 LoveIt 的版本参数 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration \n" -}} {{- else if ne .Site.Params.version $version -}} {{- errorf (printf "\n\n%s -> %s:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases \n你进行了一次不兼容的更新 参考 https://github.com/dillonzq/LoveIt/releases \n" .Site.Params.version $version) -}} {{- end -}} {{- $params := .Params | merge .Site.Params.page -}} {{- .Scratch.Set "version" "0.2.0" -}} {{- if eq hugo.Environment "production" -}} {{- .Scratch.Set "cdn" .Site.Params.cdn -}} {{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}} {{- .Scratch.Set "analytics" .Site.Params.analytics -}} {{- .Scratch.Set "comment" $params.comment -}} {{- end -}} {{- .Scratch.Set "params" $params -}} {{- $this := dict "desktop" .Site.Params.header.desktopMode "mobile" .Site.Params.header.mobileMode | dict "headerMode" | dict "config" -}} {{- .Scratch.Set "this" $this -}}