github.com/shohhei1126/hugo@v0.42.2-0.20180623210752-3d5928889ad7/docs/layouts/shortcodes/datatable.html (about)

     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  <table class="table table-bordered">
     7  	<tr>
     8  		{{ range $fields }}
     9  		<th>{{ . }}</th>
    10  		{{ end }}
    11  	</tr>
    12  	{{ range $list }}
    13  	<tr>
    14  		{{ range $k, $v := . }}
    15  		{{ $.Scratch.Set $k $v }}
    16  		{{ end }}
    17  		{{ range $fields }}
    18  			<td>{{ $.Scratch.Get . }}</td>
    19  		{{ end }}
    20  	</tr>
    21  	{{ end }}
    22  </table>