hugo-theme-relearn/layouts/partials/get-theme-variants.hugo
Sören Weber 258093e2d5
variant: allow extended configuration #679
currently only the additional name option is recognized
2023-11-20 09:39:40 +01:00

13 lines
No EOL
618 B
Text

{{- $themevariants := slice }}
{{- $tempthemevariants := slice | append (.Site.Params.themeVariant | default "auto" ) }}
{{- range $tempthemevariant := $tempthemevariants }}
{{- $themevariant := $tempthemevariant }}
{{- if not (reflect.IsMap $themevariant) }}
{{- $themevariant = dict "identifier" $tempthemevariant }}
{{- end }}
{{- if not $themevariant.name }}
{{- $themevariant = collections.Merge $themevariant (dict "name" ($themevariant.identifier | humanize | strings.Title)) }}
{{- end }}
{{- $themevariants = $themevariants | append $themevariant }}
{{- end }}
{{- return $themevariants }}