datatable.html - hugo - [fork] hugo port for 9front
HTML git clone https://git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
datatable.html (915B)
---
1 {{ $package := (index .Params 0) }}
2 {{ $listname := (index .Params 1) }}
3 {{ $list := (index (index .Site.Data.docs $package) $listname) }}
4 {{ $fields := after 2 .Params }}
5
6
7 <div class="overflow-x-auto">
8 <table>
9 <thead>
10 <tr>
11 {{ range $fields }}
12 {{ $s := . }}
13 {{ if eq $s "_key" }}
14 {{ $s = "type" }}
15 {{ end }}
16 <th>{{ $s }}</th>
17 {{ end }}
18 </tr>
19 </thead>
20 <tbody>
21 {{ range $k1, $v1 := $list }}
22 <tr>
23 {{ range $k2, $v2 := . }}
24 {{ $.Scratch.Set $k2 $v2 }}
25 {{ end }}
26 {{ range $fields }}
27 {{ $s := "" }}
28 {{ if eq . "_key" }}
29 {{ $s = $k1 }}
30 {{ else }}
31 {{ $s = $.Scratch.Get . }}
32 {{ end }}
33 <td>{{ $s }}</td>
34 {{ end }}
35 </tr>
36 {{ end }}
37 </tbody>
38 </table>
39 </div>