Welcome to mirror list, hosted at ThFree Co, Russian Federation.

switch.html « c « shortcodes « layouts - github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a3cb392b3d014c50b78bc9eae1c2aaf9eb88d246 (plain)
1
2
3
4
5
6
7
8
{{ $name := replace (.Get 0) "*" "" }}
{{ $required := strings.HasSuffix (.Get 0) "*" }}
{{ $id := $name}}

<div class="custom-control custom-switch">
  <input type="checkbox" name="{{$name}}" id="{{$id}}" class="custom-control-input" value="on">
  <label class="custom-control-label" for="{{$id}}">{{ chomp .Inner }}</label>
</div>