website_rasmus/themes/datacoop2020/layouts/services/single.html

45 lines
1 KiB
HTML
Raw Normal View History

{{- define "main" -}}
<h1>{{ .Title | markdownify }}</h1>
2022-12-07 18:31:53 +00:00
{{ .Content }}
{{- $page_params := .Params }}
{{- $translated_badges := index $.Site.Data.badges .Lang }}
<div class="service-badges">
{{ range $translated_badges.badges.active_badges }}
{{- $badge := index $translated_badges.badges.badges . }}
{{- $status_name := default "none" (index $page_params.service_badges .) -}}
{{- $status := index $translated_badges.status.status $status_name -}}
<div class="badge-icon badge-status-{{ $status_name }}">
{{ $svg := printf "static/static/img/badges/%s" $badge.icon }}
{{ $svg | readFile | safeHTML }}
</div>
<div class="badge-name">
{{ title $badge.name }}<br>
= {{ $status.name }}
</div>
<div class="badge-description">
{{- $markdown := $badge.description | markdownify -}}
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }}
<p>{{ $markdown }}</p>
{{ else }}
{{ $markdown }}
{{ end }}
</div>
{{ end }}
</div>
{{ partial "status.html" . }}
{{- end -}}