mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
851bf3515e
Also consolidate so the mediaTypes and outputFormats are listed once only. Fixes #11328
33 lines
753 B
HTML
33 lines
753 B
HTML
{{ $package := (index .Params 0) }}
|
|
{{ $listname := (index .Params 1) }}
|
|
{{ $list := (index (index .Site.Data.docs $package) $listname) }}
|
|
{{ $fields := after 2 .Params }}
|
|
|
|
|
|
<table class="table table-bordered">
|
|
<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>
|