mirror of
https://github.com/Noettore/cocoa-eh-hugo-theme.git
synced 2025-10-15 11:46:41 +02:00
Allow comments on any page, and use index.html on all sections
Addressing #56
This commit is contained in:
48
layouts/_default/index.html
Normal file
48
layouts/_default/index.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{{ 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">
|
||||
{{ $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 .Pages "Section" "blog")).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" . }}
|
Reference in New Issue
Block a user