Files
cocoa-eh-hugo-theme/layouts/index.html
Aaron Schlesinger 038d6623a0 Adding the option to turn off Google Analytics & Fix Latest Posts List (#144)
* adding option to turn off Google Analytics

* fixing the latest posts list
2020-05-17 04:13:03 -05:00

51 lines
1.8 KiB
HTML

{{ partial "header.html" . }}
<div class="main column">
<div class="container">
<div class="content">
{{ range where .Data.Pages "Title" "Home" }}
<div class="markdown">
{{ .Content }}
</div>
{{ end }}
{{ if isset .Site.Params "latestpostcount" }}
<div class="posts">
{{ $blogPosts := (where .Site.RegularPages "Section" "blog") }}
{{ $nbPosts := len $blogPosts }}
{{ if gt $nbPosts 0 }}
<div class="page-heading">Latest posts</div>
<ul>
{{ range (first .Site.Params.latestpostcount $blogPosts).GroupByDate "Jan, 2006" "desc" }}
<li class="groupby">{{ .Key }}</li>
{{ range sort .Pages "Date" "desc" }}
{{ partial "li.html" . }}
{{ end }}
{{ end }}
</ul>
{{ if gt $nbPosts .Site.Params.latestpostcount }}
<a href="./blog/" class="see-more">See more ...</a>
{{ end }}
{{ end }}
</div>
{{ end }}
<div class="best-posts">
{{ $nbPosts := len (where .Data.Pages "Params.best" true) }}
{{ if gt $nbPosts 0 }}
<div class="page-heading">Best posts</div>
<ul>
{{ range sort .Data.Pages "Date" "desc" }}
{{ if eq .Params.best true }}
{{ partial "li.html" . }}
{{ end }}
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
</div>
{{ partial "footer.html" . }}