hugo: only render subcommand link if cli data exists

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson
2025-01-09 15:34:44 +01:00
parent 5526949d36
commit effa260c24

View File

@@ -183,11 +183,13 @@ can be removed entirely in a future release.
</thead>
<tbody>
{{ range .Pages }}
<tr>
<td class="text-left"><a class="link" href="{{ .Permalink }}"><code>{{ .Title }}</code></a></th>
{{ $data := index (index site.Data .Params.datafolder) .Params.datafile }}
<td class="text-left">{{ $data.short }}</th>
</tr>
{{- if and .Params.datafolder .Params.datafile }}
<tr>
<td class="text-left"><a class="link" href="{{ .Permalink }}"><code>{{ .Title }}</code></a></th>
{{ $data := index (index site.Data .Params.datafolder) .Params.datafile }}
<td class="text-left">{{ $data.short }}</th>
</tr>
{{- end }}
{{ end }}
</tbody>
</table>