diff options
author | Dillon <dillonzq@outlook.com> | 2020-05-15 11:32:36 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-05-15 11:32:36 +0300 |
commit | c5a0ec61c9b5cc5a76dda784e1a39bbbc55ff8f7 (patch) | |
tree | f4ba9d7da0e34102405ba7f3282a4efea353e87f /layouts/_default/baseof.html | |
parent | 3fba585d79321ee0466ab25f7962293dde8efe4d (diff) |
feat(compatibility): add config for compatibility (Polyfill.io and object-fit-images)
Diffstat (limited to 'layouts/_default/baseof.html')
-rw-r--r-- | layouts/_default/baseof.html | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 07b6e5e..4303015 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,42 +1,4 @@ -{{- .Scratch.Set "version" "0.2.7" -}} -{{- $version := "0.2.X" -}} - -{{- /* LoveIt theme version detection */ -}} -{{- if eq .Site .Sites.First -}} - {{- if not .Site.Params.version -}} - {{- errorf "Configuration Error 配置文件错误\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 "Compatibility Error 兼容性错误\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 -}} -{{- end -}} - -{{- $params := .Params | merge .Site.Params.page -}} - -{{- if eq hugo.Environment "production" -}} - {{- $cdn := .Site.Params.cdn -}} - {{- with $cdn.data -}} - {{- $cdnData := printf "data/cdn/%s" . | resources.Get | transform.Unmarshal -}} - {{- $cdn = dict "simpleIconsPrefix" $cdnData.prefix.simpleIcons -}} - {{- $prefix := $cdnData.prefix.libFiles | default "" -}} - {{- range $key, $value := $cdnData.libFiles -}} - {{- $cdn = printf "%s%s" $prefix $value | dict $key | merge $cdn -}} - {{- end -}} - {{- end -}} - {{- .Scratch.Set "cdn" $cdn -}} - {{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}} - {{- .Scratch.Set "analytics" .Site.Params.analytics -}} - {{- .Scratch.Set "comment" $params.comment -}} - {{- if eq .Params.comment true -}} - {{- .Scratch.Set "comment" .Site.Params.comment -}} - {{- else if eq .Params.comment false -}} - {{- .Scratch.Set "comment" dict -}} - {{- end -}} -{{- else if eq .Site .Sites.First -}} - {{- warnf "\n\nCurrent environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}} -{{- end -}} - -{{- .Scratch.Set "params" $params -}} -{{- .Scratch.Set "this" dict -}} +{{- partial "init.html" . -}} <!DOCTYPE html> <html lang="{{ .Site.LanguageCode }}"> @@ -48,7 +10,6 @@ <title> {{- block "title" . }}{{ .Site.Title }}{{ end -}} </title> - <meta name="Description" content="{{ $params.description | default .Site.Params.description }}"> {{- partial "head/meta.html" . -}} {{- partial "head/link.html" . -}} |