website/themes/datacoop2020/layouts/partials/badges.html

50 lines
1.3 KiB
HTML
Raw Permalink Normal View History

2023-01-21 18:44:02 +00:00
<h2>{{ i18n "badges_headline" }}</h2>
<section class="badge-definitions">
{{/* TODO: This needs to be sensitive to current language */}}
{{- $translated_badges := index $.Site.Data.badges .Lang }}
{{ range $badge_key, $badge := $translated_badges.badges.badges }}
2023-01-21 18:44:02 +00:00
<div class="badge-icon">
{{$svg := printf "static/static/img/badges/%s" .icon}}
{{ $svg | readFile | safeHTML }}
</div>
<div class="badge-name">{{ title .name }}</div>
2023-01-21 18:44:02 +00:00
<div class="badge-description">
2023-03-06 08:43:17 +00:00
{{/* 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>
2023-01-21 18:44:02 +00:00
{{ end }}
</section>
2023-03-06 08:43:17 +00:00
2023-01-21 18:44:02 +00:00
<h2>{{ i18n "status_headline" }}</h2>
<section class="status-definitions">
2023-01-21 18:44:02 +00:00
{{ 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>
2023-01-21 18:44:02 +00:00
{{ end }}
</section>