diff options
| -rw-r--r-- | layouts/home.html | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/layouts/home.html b/layouts/home.html index 4d8587a..cffb6bc 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -5,9 +5,14 @@ <div class="feed-label">Latest</div> <div class="feed-grid"> - {{ range site.RegularPages }} - {{ if eq .Type "articles" }} - {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }} + {{ $articlesSection := .Site.GetPage "/articles" }} + {{ if $articlesSection }} + {{ $articles := $articlesSection.Pages }} + {{ $articles := sort $articles "Date" "desc" }} + {{ range first 6 $articles }} + {{ $type := .Params.type }} + {{ if not $type }}{{ $type = "article" }}{{ end }} + {{ $data := dict "title" .Title "type" $type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }} {{ partial "post-card.html" $data }} {{ end }} {{ end }} |
