Refactor layout and add sections
This commit is contained in:
parent
4bb821bc73
commit
286519acab
2 changed files with 202 additions and 97 deletions
19
layouts/partials/posts-recents-carte.html
Normal file
19
layouts/partials/posts-recents-carte.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{{ $n := 1 }} <!-- Change this value to set the number of posts to display -->
|
||||
{{ range first $n (where .Site.RegularPages.ByDate.Reverse "Section" "blog") }}
|
||||
|
||||
{{- $image := .Resources.GetMatch (printf "%s" .Params.cover.image) -}}
|
||||
{{- if $image -}}
|
||||
|
||||
{{- $optimizedImage := $image.Fill "100x100 webp q95 Center" -}}
|
||||
<a href="{{ .RelPermalink }}" >
|
||||
<h3>{{ .Title }}</h3>
|
||||
<img src="{{ $optimizedImage.RelPermalink }}" alt="{{ .Title }} cover image"></img>
|
||||
<small>{{ .Date.Format "January 2, 2006" }}</small>
|
||||
<p>{{ .Summary | truncate 100 }}</p>
|
||||
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ end }}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue