mirror of
https://github.com/Noettore/cocoa-eh-hugo-theme.git
synced 2025-10-15 11:46:41 +02:00
Changed blog view on home page.
* Removed date grouping of recent blog posts. * Added a paramter to specify how many posts to show.
This commit is contained in:

committed by
Alexis Tacnet

parent
436ab5acb2
commit
e02bf39694
@@ -2,27 +2,24 @@
|
||||
<section class="main">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
{{ range where .Data.Pages "Title" "Home"}}
|
||||
{{ range where .Data.Pages "Title" "Home" }}
|
||||
<div class="markdown">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<ul>
|
||||
{{ range first 5 (.Data.Pages.GroupByDate "Jan, 2006" "desc")}}
|
||||
{{ $nbPages := len (where .Pages "Section" "blog")}}
|
||||
{{ if ne $nbPages 0}}
|
||||
<li class="groupby">{{ .Key }}</li>
|
||||
{{ end }}
|
||||
{{ range where .Pages.ByPublishDate "Section" "blog"}}
|
||||
{{ $nbPosts := len (where .Data.Pages "Section" "blog") }}
|
||||
{{ if gt $nbPosts 0 }}
|
||||
<div class="page-heading">Latest posts</div>
|
||||
<ul>
|
||||
{{ range first .Site.Params.latestpostcount (where .Data.Pages "Section" "blog") }}
|
||||
{{ partial "li.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
{{ $nbTotalGroup := len (.Data.Pages.GroupByDate "Jan, 2006" "desc")}}
|
||||
{{ if gt $nbTotalGroup 5}}
|
||||
<a href="./blog/" class="see-more">See more ...</a>
|
||||
{{ if gt $nbPosts .Site.Params.latestpostcount }}
|
||||
<a href="./blog/" class="see-more">See more ...</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user