⚗️ Chore: preprocessing developer options

This commit is contained in:
Cell
2022-07-20 17:55:22 +08:00
parent 83baf0b0e0
commit 495e8286bc
4 changed files with 13 additions and 9 deletions
-1
View File
@@ -1166,7 +1166,6 @@ enableEmoji = true
# Developer options since v0.2.15
# 开发者选项 since v0.2.15
[params.dev]
# TODO 提前处理 如果 dev.enable = false 那其他值全部清空,避免后续使用时判断条件过多
enable = false
# Check for updates
# 检查更新
+9 -3
View File
@@ -21,6 +21,12 @@
{{- else if eq .Params.comment false -}}
{{- .Scratch.Set "comment" dict -}}
{{- end -}}
{{- else if eq .Site .Sites.First -}}
{{- warnf "FixIt %v\n%v\n\n" (.Scratch.Get "version") (T "devEnvWarn") -}}
{{- end -}}
{{- else -}}
{{- .Scratch.Set "devOpts" .Site.Params.dev -}}
{{- if ne .Site.Params.dev.enable true -}}
{{- .Scratch.Set "devOpts" dict -}}
{{- end -}}
{{- if eq .Site .Sites.First -}}
{{- warnf "FixIt %v\n%v\n\n" (.Scratch.Get "version") (T "devEnvWarn") -}}
{{- end -}}
{{- end -}}
+2 -3
View File
@@ -1,9 +1,9 @@
{{- $version := "v0.2.15-RC" -}}
{{- $version := .Scratch.Get "version" -}}
{{- $latest := $version -}}
{{- $devOpts := .Scratch.Get "devOpts" -}}
{{- /* Check for updates */ -}}
{{- if $devOpts.enable | and $devOpts.c4u -}}
{{- if $devOpts.c4u -}}
{{- /* Select the scope named "public_repo" to generate personal access token */ -}}
{{- $header := dict "Authorization" "" -}}
{{- with $devOpts.githubtoken -}}
@@ -27,5 +27,4 @@
{{- end -}}
{{- end -}}
{{- .Scratch.Set "version" $version -}}
{{- .Scratch.Set "latest" $latest -}}
+2 -2
View File
@@ -1,9 +1,9 @@
{{- .Scratch.Set "version" "v0.2.15-RC" -}}
{{- .Scratch.Set "params" (.Params | merge .Site.Params.page) -}}
{{- .Scratch.Set "devOpts" (.Site.Params.dev | default dict) -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-version.html" . -}}
{{- partial "init/detection-env.html" . -}}
{{- partial "init/detection-version.html" . -}}
{{- partial "init/detection-deprecated.html" . -}}
{{- partial "init/patch.html" . -}}