mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-04-30 16:14:49 +08:00
24 lines
1.2 KiB
HTML
24 lines
1.2 KiB
HTML
|
{{- $themevariants := partialCached "_relearn/themeVariants.gotmpl" .page }}
|
||
|
{{- $icon := .element.icon | default "paint-brush" }}
|
||
|
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
||
|
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
||
|
{{- end }}
|
||
|
<li class="R-variantswitcher">
|
||
|
<div class="padding menu-control">
|
||
|
<i class="{{ $icon }}"></i>
|
||
|
<span> </span>
|
||
|
<div class="control-style">
|
||
|
<label class="a11y-only" for="R-select-variant">{{ T "Theme" }}</label>
|
||
|
<select id="R-select-variant" onchange="window.relearn.changeVariant( this.value );">
|
||
|
{{- $firstvariant := true }}
|
||
|
{{- range $themevariants }}
|
||
|
{{- $themevariant := . }}
|
||
|
<option id="R-select-variant-{{ $themevariant.identifier }}" value="{{ $themevariant.identifier }}"{{- if $firstvariant }} selected{{ end }}>{{ $themevariant.name }}</option>
|
||
|
{{- $firstvariant = false }}
|
||
|
{{- end }}
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="clear"></div>
|
||
|
</div>
|
||
|
<script>window.relearn.markVariant();</script>
|
||
|
</li>
|