mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: refactor parameter params.footer.siteTime
This commit is contained in:
@@ -1,19 +1,29 @@
|
||||
{{- /* Deprecated parameter detection */ -}}
|
||||
{{- $warns := slice -}}
|
||||
{{- $errors := slice -}}
|
||||
|
||||
{{- $warnErrors := slice -}}
|
||||
{{- with .Site.Params.home.profile.gravatarSite -}}
|
||||
{{- $warnErrors = $warnErrors | append "The parameter `home.profile.gravatarSite` is deprecated since v0.2.14, use `gravatar.host` instead." -}}
|
||||
{{- $warns = $warns | append "The parameter `home.profile.gravatarSite` is deprecated since v0.2.14, use `gravatar.host` instead." -}}
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.ibruce.siteTime -}}
|
||||
{{- $warnErrors = $warnErrors | append "The parameter `ibruce.siteTime` is deprecated since v0.2.14, use `footer.siteTime` instead." -}}
|
||||
{{- $warns = $warns | append "The parameter `ibruce.siteTime` is deprecated since v0.2.14, use `footer.siteTime` instead." -}}
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.autoBookmark -}}
|
||||
{{- $warnErrors = $warnErrors | append "The parameter `autoBookmark` is deprecated since v0.2.17, use `page.autoBookmark` instead." -}}
|
||||
{{- $warns = $warns | append "The parameter `autoBookmark` is deprecated since v0.2.17, use `page.autoBookmark` instead." -}}
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.footer.custom -}}
|
||||
{{- $warnErrors = $warnErrors | append "The parameter `footer.custom` is deprecated since v0.2.17, use parameter `params.customFilePath.footer` instead." -}}
|
||||
{{- $warns = $warns | append "The parameter `footer.custom` is deprecated since v0.2.17, use parameter `params.customFilePath.footer` instead." -}}
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.footer.siteTime -}}
|
||||
{{- if gt (len .) 4 -}}
|
||||
{{- $errors = $errors | append "The parameter `footer.siteTime` has changed to an array since v0.2.17. Please correct the format!" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if len $warnErrors -}}
|
||||
{{- warnf "Deprecated parameter detection until %v\n - %v\n\n" (.Scratch.Get "version") (delimit $warnErrors "\n - ") -}}
|
||||
{{- if len $warns -}}
|
||||
{{- warnf "Deprecated parameter detection until %v\n - %v\n\n" (.Scratch.Get "version") (delimit $warns "\n - ") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if len $errors -}}
|
||||
{{- errorf "Deprecated parameter detection until %v\n - %v\n\n" (.Scratch.Get "version") (delimit $errors "\n - ") -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user