website/layouts/partials/docs/docs-portal-card.html

28 lines
1.0 KiB
HTML

{{ range .Params.cards }}
<div class="launch-card">
<div class="card-content">
<h2 id="{{ replace .title " " "-" | lower }}">{{ .title }}</h2>
<p>{{ .description }}</p>
<ul>
{{ $name := .name }}
{{ range where ($.Site.Pages.ByParam "card.weight") ".Params.card" "!=" nil }}
{{ if eq .Params.card.name $name }}
{{ $p := . }}
{{ if (isset .Params.card "anchors") }}
{{ range .Params.card.anchors }}
<li><a href="{{ $p.Permalink }}{{ .anchor }}">{{ .title }}</a></li>
{{ end }}
{{ else }}
<li><a href={{ .Permalink }}>
{{ if (isset .Params.card "title") }}{{ .Params.card.title }}{{ else }}{{ .LinkTitle }}{{ end }}
</a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{- if .button -}}
<button class="portal-button" id="btn-{{ replace .title " " "-" | lower }}" onClick="location.href='{{ .button_path | relLangURL }}';" aria-label="{{ .title }}">{{ .button }}</button>
{{- end -}}
</div>
</div>
{{ end }}