fix immagini mancanti
This commit is contained in:
parent
bd4396de86
commit
0f875ea654
40
layouts/_default/shortblock.html
Normal file
40
layouts/_default/shortblock.html
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<section class="col-6 col-12-narrower">
|
||||||
|
<div class="box post">
|
||||||
|
|
||||||
|
{{/* di default, niente immagine */}}
|
||||||
|
{{- $featimg := "#" -}}
|
||||||
|
|
||||||
|
{{- if .Params.image -}}
|
||||||
|
{{/* se è stata definita un'immagine featured */}}
|
||||||
|
{{- $img := .Page.Resources.GetMatch .Params.image -}}
|
||||||
|
{{- $featimg = $img.RelPermalink -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- if .Params.featured -}}
|
||||||
|
{{/* se è stata definita un'immagine featured */}}
|
||||||
|
{{- $img := .Page.Resources.GetMatch .Params.featured -}}
|
||||||
|
{{- $featimg = $img.RelPermalink -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{/* altrimenti prendo la prima risorsa immagine disponibile */}}
|
||||||
|
{{- $img := (.Page.Resources.ByType "image").GetMatch "**" -}}
|
||||||
|
{{- if $img -}}
|
||||||
|
{{- $featimg = $img.RelPermalink -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
<a href="{{ .RelPermalink }}" class="image left"><img src="{{ $featimg }}" alt="{{ .Params.image_alt }}" /></a>
|
||||||
|
<div class="inner">
|
||||||
|
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
||||||
|
{{ if .Site.Params.show_post_dates | default true }}
|
||||||
|
{{- with .Date }}<time>{{ . | time.Format ":date_medium" }}</time>{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
<p>
|
||||||
|
{{ with .Description }}
|
||||||
|
{{- . }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Summary }}
|
||||||
|
{{- end }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
Loading…
x
Reference in New Issue
Block a user