tabs.html 609 B

1234567891011121314151617181920212223
  1. {{- if .Inner }}{{ end }}
  2. {{- $id := .Get 0 }}
  3. {{- $group := printf "tabs-%s" $id }}
  4. <div class="gdoc-tabs">
  5. {{- range $index, $tab := .Scratch.Get $group }}
  6. <input
  7. type="radio"
  8. class="gdoc-tabs__control hidden"
  9. name="{{ $group }}"
  10. id="{{ printf "%s-%d" $group $index }}"
  11. {{ if not $index }}checked="checked"{{ end }}
  12. />
  13. <label for="{{ printf "%s-%d" $group $index }}" class="gdoc-tabs__label">
  14. {{ $tab.Name }}
  15. </label>
  16. <div class="gdoc-markdown--nested gdoc-tabs__content">
  17. {{ .Content | $.Page.RenderString }}
  18. </div>
  19. {{- end }}
  20. </div>