Omphaloskepsis-2/layouts/shortcodes/chart.html

39 lines
1.2 KiB
HTML
Raw Normal View History

2023-10-03 13:08:35 +01:00
{{- if ( not ( .Get "longdesc" ) ) -}}
{{- erroridf "a11y-chart-longdesc" "No longdesc found for chart '%q' (%q)" ( .Get "chart-id" ) .Page.File.Path -}}
{{- end -}}
2025-01-11 16:18:22 +01:00
<figure
class="article__figure figure figure--chart{{ with .Get "class" }}{{ . }}{{ end }}"
role="group"
>
{{- with .Get "chart-id" -}}
<div class="chart-container">
<canvas
width="auto"
class="chart"
id="{{ . }}"
>
2024-07-23 10:08:36 +02:00
You must enable Javascript to view this chart.
2025-01-11 16:18:22 +01:00
</canvas>
</div>
{{- end -}}
{{- with .Get "chart-id-2" -}}
<div class="chart-container">
<canvas
class="chart"
id="{{ . }}"
>
2024-07-23 10:08:36 +02:00
You must enable Javascript to view this chart.
2025-01-11 16:18:22 +01:00
</canvas>
</div>
{{- end -}}
2023-08-22 11:14:33 +01:00
2025-01-11 16:18:22 +01:00
{{- if or ( .Get "caption" ) ( .Get "title" ) -}}
<figcaption class="figure__caption{{ if not ( or ( .Get "caption" ) ( .Get "title" ) ) }}figure__caption--no-height{{ end }}">
{{- with .Get "title" -}}<h4 class="figcaption__title">{{ . | markdownify | safeHTML }}</h4>{{- end -}}
2025-02-21 23:17:58 +01:00
{{- with .Get "caption" -}}<p class="figcaption__caption">{{ . | $.Page.RenderString }}</p>{{- end -}}
2025-01-11 16:18:22 +01:00
</figcaption>
{{- end -}}
2023-08-22 11:14:33 +01:00
</figure>