Omphaloskepsis-2/layouts/partials/item-tile.html

101 lines
3.5 KiB
HTML
Raw Normal View History

2023-12-12 22:40:30 +00:00
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
2025-03-02 22:41:10 +01:00
<article class="item-tile item-tile--redacted {{- with .Params.site }}item-tile--{{ . }}{{ end -}}">
2023-12-12 22:40:30 +00:00
<header class="item-tile__header">
2025-03-02 22:41:10 +01:00
<h2
class="p-name item-tile__title{{ if gt ( len ( .Title | plainify ) ) 40 }}item-tile__title--long{{ end }}"
itemprop="name"
>
{{- partialCached "redact-black.html" . -}}
</h2>
<p style="display: none;">
Published:
<time
class="dt-published"
itemprop="datePublished"
datetime="{{ .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}"
>{{ .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}</time
>
</p>
2023-12-12 22:40:30 +00:00
</header>
</article>
{{- end -}}
{{- else -}}
2025-03-02 22:41:10 +01:00
<a
id="{{ .Title | urlize }}"
class="h-entry u-url link--tile"
href="{{ .RelPermalink }}"
itemprop="blogPost"
itemscope
itemtype="https://schema.org/BlogPosting"
>
<article
class="item-tile lazy {{- with .Params.site }}item-tile--{{ . }}{{ end -}}"
{{ if .Params.featured_image }}
2025-06-04 17:57:21 +02:00
style="background-image: url(
2025-03-02 22:41:10 +01:00
{{ with .Resources.GetMatch .Params.featured_image }}
2025-06-04 17:57:21 +02:00
{{- partialCached "images/get-image.html" ( dict "img" . "size" "500x" ) ( printf "%s-500x" .Title ) -}}
{{- else -}}
{{- warnf "Featured image %s is not a page resource" .Params.featured_image -}}
{{- .Params.featured_image -}}
{{- end -}}
)"
2025-03-02 22:41:10 +01:00
{{ end }}
>
{{ if .Params.featured_image -}}
<img
class="u-photo"
style="display: none;"
src="
2023-12-12 22:40:30 +00:00
{{- with .Resources.GetMatch .Params.featured_image -}}
2025-06-04 17:57:21 +02:00
{{- partialCached "images/get-image.html" ( dict "img" . "size" "500x" ) ( printf "%s-500x" .Title ) -}}
2023-12-12 22:40:30 +00:00
{{- else -}}
2025-06-04 17:57:21 +02:00
{{- warnf "Featured image %s is not a page resource" .Params.featured_image -}}
{{- .Params.featured_image -}}
2023-12-12 22:40:30 +00:00
{{ end }}
2025-03-02 22:41:10 +01:00
"
alt="
2023-12-12 22:40:30 +00:00
{{- with .Resources.GetMatch .Params.featured_image -}}
{{- .Params.alt -}}
2023-06-30 21:16:59 -06:00
{{- end -}}
2023-12-12 22:40:30 +00:00
"
2025-03-02 22:41:10 +01:00
/>
{{- end }}
2025-04-09 10:15:56 +02:00
<header class="item-tile__header item-tile__title-wrapper">
2025-03-02 22:41:10 +01:00
{{ if ( or .Params.series .Params.published_in ) }}
<span
2025-04-09 10:15:56 +02:00
class="item-tile__banner item-tile__banner--{{ if .Params.series -}}
2025-03-02 22:41:10 +01:00
series
2025-04-09 10:15:56 +02:00
{{- else if .Params.published_in -}}
2025-03-02 22:41:10 +01:00
published-in
2025-04-09 10:15:56 +02:00
{{- end }}"
2025-03-02 22:41:10 +01:00
>
2023-12-12 22:40:30 +00:00
{{- if .Params.series -}}
{{ .Params.series | safeHTML }}
{{- else if .Params.published_in -}}
2025-05-06 19:27:35 +02:00
{{ .Params.published_in | .Page.RenderString | safeHTML }}
2023-12-12 22:40:30 +00:00
{{- end -}}
</span>
2025-03-02 22:41:10 +01:00
{{ end }}
2025-04-09 10:15:56 +02:00
2025-04-15 13:10:38 +02:00
{{- if .File -}}
2025-05-15 11:08:14 +02:00
{{- partial "text/item-title.html" ( dict "pc" . "sc" $ "class" "item-tile" ) -}}
2025-04-15 13:10:38 +02:00
{{- else -}}
{{- partial "text/item-title.html" ( dict "pc" . "sc" $ "class" "item-tile" ) -}}
{{- end -}}
2025-04-09 10:15:56 +02:00
2025-03-02 22:41:10 +01:00
<p style="display: none;">
Published:
<time
class="dt-published"
itemprop="datePublished"
datetime="{{ .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}"
>{{ .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}</time
>
</p>
2023-12-12 22:40:30 +00:00
</header>
</article>
</a>
{{- end -}}