blog/themes/conspiracy/layouts/_partials/card.html
jaseg 16655c00e0 Fix hugo layout in hugo > ~0.130.0
For some reason, newer hugo versions have trouble with .summary, and on
some pages where .summary is not defined in the page header metadata,
when rendering the page as a preview card, hugo swallows the card's
closing </div> tag. Such a weird bug, we now just work around it by
explicitly setting the .summary meta on pages that cause this bug(?) to
surface.
2025-06-30 15:35:25 +02:00

17 lines
564 B
HTML

<div class="card">
{{- if .Title }}<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>{{- end }}
{{- if and .Date (not (isset (index .Ancestors 0).Params "hide_date")) }}<strong>{{ .Date.Format "2006-01-02" }}</strong>{{- end }}
<div class="summary">
{{ .Summary }}
<a href="{{ .Permalink }}">Read more</a>
</div>
{{- if .Params.external_links }}
<div class="links">
{{- range .Params.external_links }}
<a href="{{ .url | absURL }}">{{ .name }}</a>
{{- end }}
</div>
{{- end }}
</div>