diff options
author | parsiya <parsiya@gmail.com> | 2018-03-11 09:52:50 +0300 |
---|---|---|
committer | parsiya <parsiya@gmail.com> | 2018-03-11 09:52:50 +0300 |
commit | ab87a6180ee31d590e95aae11e89ff6f0064e886 (patch) | |
tree | bec2272e49564b12f2bb83ef413f60bccbb0576a | |
parent | d9db1d4e717904ba99411674e5f92fec5425e24d (diff) |
Only show posts (excluding pages) in recent posts. Fixes #49
-rw-r--r-- | layouts/partials/sidebar.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index c0968b8..d115252 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -66,14 +66,16 @@ <section class="even"> <h1>Recent Posts</h1> <ul id="recent_posts"> - {{ range first . $.Site.Pages }} - <li class="post"> - <a href="{{ .RelPermalink }}">{{ .Title }}</a> - </li> + {{ $pages := where $.Site.Pages "Type" "post" }} + {{ range first . $pages }} + {{ if .IsPage }} + <li class="post"> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + </li> + {{ end }} {{ end }} </ul> </section> {{ end }} {{ end }} - </aside> |