portails/layouts/_default/versions.html

28 lines
1.1 KiB
HTML

{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
<p class="lead">{{ .Params.lead | safeHTML }}</p>
{{ .Content }}
<div class="row">
{{ range $release := sort (index $.Site.Data "docs-versions") "group" "desc" -}}
<div class="col-md-8 col-lg-4 col-xl mb-4">
<h2>{{ $release.group }}</h2>
<p>{{ $release.description }}</p>
{{ $versions := sort $release.versions "v" "desc" -}}
{{ range $i, $version := $versions -}}
{{ $len := len $versions -}}
{{ if (eq $i 0) }}<div class="list-group">{{ end }}
<a class="list-group-item list-group-item-action py-2 text-primary{{ if (eq $version.v $.Site.Params.docsVersion) }} d-flex justify-content-between align-items-center{{ end }}" href="{{ $release.baseurl }}/{{ $version.v }}/">
{{ $version.v }}
{{ if (eq $version.v $.Site.Params.docsVersion) -}}
<span class="badge bg-primary">Latest</span>
{{ end -}}
</a>
{{ if (eq (add $i 1) $len) }}</div>{{ end }}
{{ end -}}
</div>
{{ end -}}
</div>
</article>
{{ end }}