diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 95257fe..1f18236 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -22,6 +22,7 @@ logofile = "img/logo.png" faviconfile = "img/logo.png" highlightjs = true progressively = true +latestpostcount = 10 lang = "en" github = "example" email = "you@example.com" diff --git a/layouts/index.html b/layouts/index.html index 1add9bc..849493b 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,27 +2,24 @@
- {{ range where .Data.Pages "Title" "Home"}} + {{ range where .Data.Pages "Title" "Home" }}
{{ .Content }}
{{ end }} -
    - {{ range first 5 (.Data.Pages.GroupByDate "Jan, 2006" "desc")}} - {{ $nbPages := len (where .Pages "Section" "blog")}} - {{ if ne $nbPages 0}} -
  • {{ .Key }}
  • - {{ end }} - {{ range where .Pages.ByPublishDate "Section" "blog"}} + {{ $nbPosts := len (where .Data.Pages "Section" "blog") }} + {{ if gt $nbPosts 0 }} +
    Latest posts
    +
      + {{ range first .Site.Params.latestpostcount (where .Data.Pages "Section" "blog") }} {{ partial "li.html" . }} {{ end }} - {{ end }} -
    +
- {{ $nbTotalGroup := len (.Data.Pages.GroupByDate "Jan, 2006" "desc")}} - {{ if gt $nbTotalGroup 5}} - See more ... + {{ if gt $nbPosts .Site.Params.latestpostcount }} + See more ... + {{ end }} {{ end }}