aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/index.html
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2024-12-28 05:36:38 +0100
committerOscar Najera <hi@oscarnajera.com>2024-12-28 05:36:38 +0100
commitcb1d03ea430c4afd3175d740d79832ddde469577 (patch)
tree3f74d53b91ceb68ae6ca814f849c92dfa9b943dd /layouts/index.html
parent13d8e69b93c51776cd7fe73961f6873d756a995e (diff)
downloadhugo-minimalist-theme-cb1d03ea430c4afd3175d740d79832ddde469577.tar.gz
hugo-minimalist-theme-cb1d03ea430c4afd3175d740d79832ddde469577.tar.bz2
hugo-minimalist-theme-cb1d03ea430c4afd3175d740d79832ddde469577.zip
homepage shows only sections with entries
Diffstat (limited to 'layouts/index.html')
-rw-r--r--layouts/index.html36
1 files changed, 19 insertions, 17 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 905bb07..fb866ad 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -3,25 +3,27 @@
{{ end }}
{{ define "main" }}
- {{ range $index, $element := (where .Pages "Type" "in" .Site.Params.mainSections).ByWeight }}
- <div class="stripe-dark">
- <div class="mw7 center pa1">
- <h2
- id="{{ anchorize .Title | safeURL }}"
- class="baskerville lh-title f2"
- >
- {{ .Title }}
- </h2>
- {{ range first 3 .Pages.ByPublishDate.Reverse }}
- {{ partial "post.html" . }}
- {{ end }}
- <div class="tc pa3">
- <i class="fas fa-angle-right"></i>
- <a href="{{ .Type }}" class="f3 link near-black"
- >{{ T "see_all" | humanize }}</a
+ {{ range (where .Pages "Type" "in" .Site.Params.mainSections).ByWeight }}
+ {{ if gt (len .Pages) 0 }}
+ <div class="stripe-dark">
+ <div class="mw7 center pa1">
+ <h2
+ id="{{ anchorize .Title | safeURL }}"
+ class="baskerville lh-title f2"
>
+ {{ .Title }}
+ </h2>
+ {{ range first 3 .Pages.ByPublishDate.Reverse }}
+ {{ partial "post.html" . }}
+ {{ end }}
+ <div class="tc pa3">
+ <i class="fas fa-angle-right"></i>
+ <a href="{{ .Type }}" class="f3 link near-black"
+ >{{ T "see_all" | humanize }}</a
+ >
+ </div>
</div>
</div>
- </div>
+ {{ end }}
{{ end }}
{{ end }}