diff options
Diffstat (limited to 'docs/layouts/shortcodes/datatable.html')
-rw-r--r-- | docs/layouts/shortcodes/datatable.html | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/docs/layouts/shortcodes/datatable.html b/docs/layouts/shortcodes/datatable.html index 4e2814f5a..12054f89d 100644 --- a/docs/layouts/shortcodes/datatable.html +++ b/docs/layouts/shortcodes/datatable.html @@ -3,20 +3,31 @@ {{ $list := (index (index .Site.Data.docs $package) $listname) }} {{ $fields := after 2 .Params }} + <table class="table table-bordered"> - <tr> - {{ range $fields }} - <th>{{ . }}</th> - {{ end }} - </tr> - {{ range $list }} - <tr> - {{ range $k, $v := . }} - {{ $.Scratch.Set $k $v }} - {{ end }} - {{ range $fields }} - <td>{{ $.Scratch.Get . }}</td> - {{ end }} - </tr> - {{ end }} + <tr> + {{ range $fields }} + {{ $s := . }} + {{ if eq $s "_key" }} + {{ $s = "Type" }} + {{ end }} + <th>{{ $s }}</th> + {{ end }} + </tr> + {{ range $k1, $v1 := $list }} + <tr> + {{ range $k2, $v2 := . }} + {{ $.Scratch.Set $k2 $v2 }} + {{ end }} + {{ range $fields }} + {{ $s := "" }} + {{ if eq . "_key" }} + {{ $s = $k1 }} + {{ else }} + {{ $s = $.Scratch.Get . }} + {{ end }} + <td>{{ $s }}</td> + {{ end }} + </tr> + {{ end }} </table> |