website/themes/datacoop2020/layouts/partials/badges.html
Benjamin Bach bf9dd9bd92
All checks were successful
continuous-integration/drone/pr Build is passing
Grid layout for service badge and status definitions, adds CSS for status badges
2023-03-06 12:10:09 +01:00

48 lines
1.1 KiB
HTML

<h2>{{ i18n "badges_headline" }}</h2>
<section class="badge-definitions">
{{ range $badge_key, $badge := $.Site.Data.badges.da.badges.badges }}
<div class="badge-icon">
{{$svg := printf "static/static/img/badges/%s" .icon}}
{{ $svg | readFile | safeHTML }}
</div>
<div class="badge-name">{{ title .name }}</div>
<div class="badge-description">
{{/* Hugo is insane some times: https://github.com/gohugoio/hugo/issues/3040 */}}
{{- $markdown := .description | markdownify -}}
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }}
<p>{{ $markdown }}</p>
{{ else }}
{{ $markdown }}
{{ end }}
</div>
{{ end }}
</section>
<h2>{{ i18n "status_headline" }}</h2>
<section class="status-definitions">
{{ range $.Site.Data.badges.da.status.status }}
<div class="badge-icon badge-status badge-status-{{ .css_class }}"></div>
<div class="badge-name">{{ title .name }}</div>
<div class="badge-description">
{{- $markdown := .description | markdownify -}}
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }}
<p>{{ $markdown }}</p>
{{ else }}
{{ $markdown }}
{{ end }}
</div>
{{ end }}
</section>