redesign 2023

This commit is contained in:
m3tam3re
2023-10-12 14:01:05 +02:00
commit 19bfc7311a
3053 changed files with 76380 additions and 0 deletions

View File

@ -0,0 +1,30 @@
{{- $version := .Scratch.Get "version" -}}
{{- $latest := $version -}}
{{- $devOpts := .Scratch.Get "devOpts" -}}
{{- /* Check for updates */ -}}
{{- if $devOpts.c4u -}}
{{- /* Select the scope named "public_repo" to generate personal access token */ -}}
{{- $header := dict "Authorization" "" -}}
{{- with $devOpts.githubtoken -}}
{{- $header = dict "Authorization" (printf "token %v" .) -}}
{{- end -}}
{{- $latest = (getJSON "https://api.github.com/repos/hugo-fixit/FixIt/releases/latest" $header).tag_name -}}
{{- end -}}
{{- /* FixIt theme version detection */ -}}
{{- if eq .Site .Sites.First -}}
{{- if not .Site.Params.version -}}
{{- errorf "FixIt %v\n%v\n\n" $version (T "init.configurationError") -}}
{{- else if gt "0.2.0" (strings.TrimPrefix "v" .Site.Params.version) -}}
{{- errorf "FixIt %v\n%v\n\n" $version (dict "From" .Site.Params.version "To" $version | T "init.compatibilityError") -}}
{{- end -}}
{{- if (strings.HasSuffix $version "RC") | and $devOpts.c4u -}}
{{- warnf "FixIt %v\n%v\n\n" $version (T "init.RCVersionWarn") -}}
{{- end -}}
{{- if (gt $latest $version) | and $devOpts.c4u -}}
{{- warnf "FixIt %v (⬆️ %v)\n%v`git submodule update --remote --merge`\n\n" $version $latest (T "init.quicklyUpgrade") -}}
{{- end -}}
{{- end -}}
{{- .Scratch.Set "latest" $latest -}}