histoiredunpied/layouts/shortcodes/actu.html

24 lines
927 B
HTML

<div class="news">
{{ with .Site.GetPage "/actu" }}
{{ $actu := . }}
{{ range .Resources.ByType "page" }}
{{ if or (not .Params.draft) (eq hugo.Environment "development") }}
<article class="card grid -middle -even-reverse">
<div class="card-image cell -5of12">
{{ $src := $actu.Resources.GetMatch (printf "*%s/%s*" (path.Base .File.Dir) (.Params.Image)) }}
{{ if $src }}
{{ $image := $src.Fill "432x300 Center" }}
<img src="{{ $image.RelPermalink }}" />
{{ end }}
</div>
<div class="card-body cell -7of12">
<h3>{{ .Title }}</h3>
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}</time>
{{ .Content }}
</div>
</article>
{{ end }}
{{ end }}
{{ end }}
</div>