rename .html.tmpl
files to .html
This commit is contained in:
parent
438fdbe22d
commit
37da8acf5a
27 changed files with 29 additions and 29 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue