Better look for incoming posts

master
Quentin Duchemin 2023-09-28 10:05:00 +02:00
parent 8134be06a9
commit f04015d274
Signed by: Chosto
GPG Key ID: 96AB8AE7DFEA3D74
1 changed files with 11 additions and 5 deletions

View File

@ -1,17 +1,21 @@
<div class="card has-equal-height"> <div class="card has-equal-height {{ if .Params.incoming }}has-background-white-bis{{ end }}">
<div class="card-image"> <div class="card-image">
<figure class="image is-3by2"> <figure class="image is-3by2">
{{ $imageURL := "https://bulma.io/images/placeholders/480x320.png" }} {{ $imageURL := "https://bulma.io/images/placeholders/480x320.png" }}
{{ with .Resources.GetMatch "top.jpg" }} {{ with .Resources.GetMatch "top.jpg" }}
{{ $image := .Fill "480x320 left" }} {{ $image := .Fill "480x320 left" }}
{{/* #FIXME why do $image gets overwritten when $imageURL is set only once outside the conditional */}}
{{ if $.Params.incoming }}{{ $image = $image.Filter (images.Grayscale)}}{{ $imageURL = $image.Permalink }}
{{ else }}
{{ $imageURL = $image.Permalink }} {{ $imageURL = $image.Permalink }}
{{ end }} {{ end }}
<a href="{{ .Permalink }}"><img src="{{ $imageURL }}" alt="Placeholder image"></a> {{ end }}
<a class="{{ if .Params.incoming }}disabled{{ end }}" href="{{ if .Params.incoming }}#{{ else }}{{ .Permalink }}{{ end }}"><img src="{{ $imageURL }}" alt="Placeholder image"></a>
</figure> </figure>
</div> </div>
<div class="columns is-flex-direction-column card-content pb-0" style="height:100%;"> <div class="columns is-flex-direction-column card-content pb-0" style="height:100%;">
<div class="column is-flex-grow-0 has-text-centered pb-0"> <div class="column is-flex-grow-0 has-text-centered pb-0">
<a class="title is-4 mb-0" href="{{.Permalink}}"> <a class="title is-4 mb-0 {{ if .Params.incoming }}disabled{{ end }}" href="{{ if .Params.incoming }}#{{ else }}{{.Permalink}}{{ end }}">
{{- /* {{- /*
Well, I am a beginner with Hugo so this is probably like crushing a banana with a rocket. Well, I am a beginner with Hugo so this is probably like crushing a banana with a rocket.
When a post belongs to a "case" (i.e. a section with a code, I'd like to have [INDEX/TOTAL] printed in title. When a post belongs to a "case" (i.e. a section with a code, I'd like to have [INDEX/TOTAL] printed in title.
@ -39,10 +43,12 @@
<div class="column is-flex-grow-0 pt-2 pb-3"> <div class="column is-flex-grow-0 pt-2 pb-3">
<hr class="my-0"> <hr class="my-0">
</div> </div>
<div class="column py-0"> <div class="column py-0 {{ if .Params.incoming }}has-text-centered{{ end }}">
{{ if .Params.incoming }}
À venir...
{{- /* If a special summary (before ToC) have been defined, {{- /* If a special summary (before ToC) have been defined,
prefer using it because it has more chances to be a better summary */}} prefer using it because it has more chances to be a better summary */}}
{{ if (isset .Params "summary" )}} {{ else if (isset .Params "summary" )}}
{{ .Params.summary }} {{ .Params.summary }}
{{ else }} {{ else }}
{{ .Content | plainify | safeHTML | truncate 300 "..." }} {{ .Content | plainify | safeHTML | truncate 300 "..." }}