This commit is contained in:
2020-02-14 16:40:46 +01:00
parent 9a611bbf32
commit 49a69633ba
27 changed files with 356 additions and 120 deletions

View File

@ -0,0 +1,23 @@
<div class="news">
{{ with .Site.GetPage "/actu" }}
{{ $actu := . }}
{{ range .Resources.ByType "page" }}
{{ if or (not .Params.draft) (eq .Hugo.Environment "development") }}
<article class="card">
<div class="card-image">
{{ $src := $actu.Resources.GetMatch (printf "*%s/%s*" (path.Base .File.Dir) (.Params.Image)) }}
{{ if $src }}
{{ $image := $src.Fill "432x300" }}
<img src="{{ $image.RelPermalink }}" />
{{ end }}
</div>
<div class="card-body">
<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>

View File

@ -0,0 +1,10 @@
{{ $class := .Get "class" }}
{{ $body := .Get "text" | default .Inner }}
{{ $markdown := .Get "markdown" | default false }}
<div class="cell{{ with $class }} {{ . }}{{ end }}">
{{ if $markdown }}
{{ $.Page.RenderString .Inner }}
{{ else }}
{{ .Inner }}
{{ end }}
</div>

View File

@ -0,0 +1,3 @@
{{ $class := .Get "class" }}
{{ $body := .Get "text" | default .Inner }}
<div class="grid{{ with $class }} {{ . }}{{ end }}">{{ $body }}</div>

View File

@ -0,0 +1 @@
{{ partial "image.html" . }}