~ruther/blog

ref: b9c795d2bfcecd327f2b0ccf70ea55497b4ec09b blog/themes/poison/layouts/shortcodes/tabs.html -rw-r--r-- 959 bytes
b9c795d2 — Rutherther chore: guix manifest 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{ $tabTotal := .Get "tabTotal" }}
{{ $tabName := .Scratch.Get "tabName" }}
{{ $tabContent := .Scratch.Get "tabContent" }}
{{ $tabID := .Scratch.Get "tabID" }}

<div class="tabs-container">
    <div class="tabs" role="tablist">

	    {{ range $i, $sequence := (seq $tabTotal) }}
        
            {{ if eq $i 0 }}
            <button class="tab active" id="{{ (index $tabID $i) }}">
            {{ else }}
            <button class="tab" id="{{ (index $tabID $i) }}">
            {{ end }}

                {{ index $tabName $i }}
            </button>

	    {{ end }}

    </div>

    {{ range $i, $sequence := (seq $tabTotal) }}
    
        {{ if eq $i 0 }}
            <div class="tabcontent {{ (index $tabID $i) }}" style="display:block;">
        {{ else }}
            <div class="tabcontent {{ (index $tabID $i) }}">
        {{ end }}

        {{ (index $tabContent $i) }}
        {{ if $.Inner }}
        {{ end }}
    </div>
    {{ end }}
</div>