variant: restore storage of nested variants #679

This commit is contained in:
Sören Weber 2023-12-04 18:03:53 +01:00
parent edf50b44fe
commit d07497d2fc
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -50,8 +50,6 @@ Non-auto run
{{- $themevariant := $tempthemevariant }} {{- $themevariant := $tempthemevariant }}
{{- if not (collections.IsSet $themevariant "auto") }} {{- if not (collections.IsSet $themevariant "auto") }}
{{- $themevariant = partial "get-theme-details.html" (dict "themevariant" $themevariant "identifier" $themevariant.identifier "mod" $mod)}} {{- $themevariant = partial "get-theme-details.html" (dict "themevariant" $themevariant "identifier" $themevariant.identifier "mod" $mod)}}
{{- $cssres := $themevariant.themecontent | resources.FromString (printf "css/theme-%s%s.css" $themevariant.identifier $mod) }}
{{- /* the following code causes Hugo to generate our css file - although it is in comments */}}<!-- {{ $cssres.RelPermalink }} -->
{{- end }} {{- end }}
{{- $themevariants = $themevariants | append $themevariant }} {{- $themevariants = $themevariants | append $themevariant }}
{{- end }} {{- end }}
@ -145,7 +143,8 @@ Auto run
{{- end }} {{- end }}
{{- $themecontent = replaceRE `(:root\s*\{[ \t]*)(\s*)` (printf "${1}${2}--CODE-theme: %s;${2}" $chroma) $themecontent }} {{- $themecontent = replaceRE `(:root\s*\{[ \t]*)(\s*)` (printf "${1}${2}--CODE-theme: %s;${2}" $chroma) $themecontent }}
{{- end }} {{- end }}
{{- $themevariant = collections.Merge $themevariant (dict "themecontent" $themecontent) }}
{{- $themevariant = collections.Merge $themevariant (dict "chroma" $chroma) }} {{- $themevariant = collections.Merge $themevariant (dict "chroma" $chroma) }}
{{- $cssres := $themecontent | resources.FromString (printf "css/theme-%s%s.css" $identifier $mod) }}
{{- /* the following code causes Hugo to generate our css file - although it is in comments */}}<!-- {{ $cssres.RelPermalink }} -->
{{- return $themevariant }} {{- return $themevariant }}
{{- end }} {{- end }}