hugo-theme-relearn/layouts/partials/get-theme-variants.hugo

13 lines
618 B
Text
Raw Normal View History

{{- $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 }}