website/themes/datacoop2020/layouts/partials/badges.html
Benjamin Bach f5f40320b8
All checks were successful
continuous-integration/drone/pr Build is passing
Add content from current website, add smooth scrolling
2023-04-01 23:32:25 +02:00

27 lines
799 B
HTML

<h2 id="badges">{{ 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 }}
<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>