rename .html.tmpl files to .html

This commit is contained in:
Ben Goldsworthy 2025-01-05 17:25:32 +01:00
parent 438fdbe22d
commit 37da8acf5a
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE
27 changed files with 29 additions and 29 deletions

View file

@ -0,0 +1,34 @@
<!--
Renders related items as an unordered list.
@params section_title Title of the sub-section to show (e.g. "Blog Posts").
@params content Related items.
-->
{{- $section_title := .section_title -}}
{{- $content := .content -}}
<h2 class="subheading">{{ $section_title }} ({{ len $content }})</h2>
<ul class="related-items related-items--list">
{{- range $content -}}
{{- $is_expired := and ( isset .Params "end_date" ) ( lt .Params.end_date ( (time now).Format "2006-01-02" ) ) -}}
<li class="related-item{{- if $is_expired }} related-item--expired{{- end -}}">
<a href="{{- .RelPermalink -}}">
{{- .Title | safeHTML -}}
</a>
{{- with .Params.grade -}}
<span class="related-item__grade">
Grade: {{ . -}}
</span>
{{- end -}}
{{- with .Params.end_date -}}
<span class="related-item__expiry">
<abbr title="expire{{- if $is_expired -}}d{{- else -}}s{{- end -}}">Exp</abbr>: {{ dateFormat "Jan 2 2006" . -}}
</span>
{{- end -}}
</li>
{{- end -}}
</ul>