diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 1f18236..ce8de87 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -22,7 +22,7 @@ logofile = "img/logo.png"
faviconfile = "img/logo.png"
highlightjs = true
progressively = true
-latestpostcount = 10
+latestpostcount = 5
lang = "en"
github = "example"
email = "you@example.com"
diff --git a/exampleSite/content/blog/example-of-an-article.md b/exampleSite/content/blog/example-of-an-article.md
index 99c14dc..ad24994 100644
--- a/exampleSite/content/blog/example-of-an-article.md
+++ b/exampleSite/content/blog/example-of-an-article.md
@@ -2,6 +2,7 @@
author: "Alexis Tacnet"
date: 2015-09-28
title: Example article
+best: true
---
## Text
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index 54b2c0b..8348150 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -10,16 +10,18 @@
{{ end }}
{{ end }}
+
{{ if ne (len (where .Data.Pages "Title" "!=" $globalTitle)) 0}}
-
{{ .Title }}
-
- {{ range .Data.Pages.ByPublishDate }}
- {{ if ne .Title $globalTitle }}
- {{ partial "li.html" . }}
+ {{ .Title }}
+
+ {{ range .Data.Pages.ByPublishDate }}
+ {{ if ne .Title $globalTitle }}
+ {{ partial "li.html" . }}
+ {{ end }}
{{ end }}
- {{ end }}
-
+
{{ end }}
+
diff --git a/layouts/index.html b/layouts/index.html
index 849493b..94e632f 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -8,12 +8,16 @@
{{ end }}
+
{{ $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" . }}
+ {{ range (first .Site.Params.latestpostcount (where .Pages "Section" "blog")).GroupByDate "Jan, 2006" "desc" }}
+ - {{ .Key }}
+ {{ range .Pages.ByPublishDate }}
+ {{ partial "li.html" . }}
+ {{ end }}
{{ end }}
@@ -21,6 +25,21 @@
See more ...
{{ end }}
{{ end }}
+
+
+
+ {{ $nbPosts := len (where .Data.Pages "Params.best" true) }}
+ {{ if gt $nbPosts 0 }}
+
Best posts
+
+ {{ range .Data.Pages.ByPublishDate }}
+ {{ if eq .Params.best true }}
+ {{ partial "li.html" . }}
+ {{ end }}
+ {{ end }}
+
+ {{ end }}
+
diff --git a/layouts/section/blog.html b/layouts/section/blog.html
index bd20396..f89835d 100644
--- a/layouts/section/blog.html
+++ b/layouts/section/blog.html
@@ -2,15 +2,17 @@