mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
Merge commit 'b3d87dd0fd
'
This commit is contained in:
commit
61a286595e
101 changed files with 503 additions and 164 deletions
39
docs/layouts/_shortcodes/datatable.html
Normal file
39
docs/layouts/_shortcodes/datatable.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
{{ $package := (index .Params 0) }}
|
||||
{{ $listname := (index .Params 1) }}
|
||||
{{ $list := (index (index .Site.Data.docs $package) $listname) }}
|
||||
{{ $fields := after 2 .Params }}
|
||||
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{{ range $fields }}
|
||||
{{ $s := . }}
|
||||
{{ if eq $s "_key" }}
|
||||
{{ $s = "type" }}
|
||||
{{ end }}
|
||||
<th>{{ $s }}</th>
|
||||
{{ end }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ 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 }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue