Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Commit

Permalink
Fix inclusion of other page types under "latest posts"
Browse files Browse the repository at this point in the history
With Hugo 0.18 everything has become a page of a certain *kind*.
The "latest posts" section ranges over all pages but didn't exclude
those that were not of the kind "page".
  • Loading branch information
digitalcraftsman committed Jan 21, 2017
1 parent 7504618 commit 6042968
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions layouts/partials/latest-posts.html
@@ -1,11 +1,13 @@
<ul id="post-list" class="archive readmore">
<h3>{{ with .Site.Params.readMore }}{{ . }}{{ else }}Read more{{ end }}</h3>
{{ range first 10 (where .Site.Pages "Params.hidden" "ne" "true") }}

{{ $pages := where .Site.Pages "Kind" "page" }}
{{ range first 10 (where $pages "Params.hidden" "ne" "true") }}
{{ $url := replace .Permalink .Site.BaseURL "" }}
{{ if and (ne $url "about/") }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}<aside class="dates">{{ .Date.Format "Jan 2" }}</aside></a>
</li>
{{ end }}
{{ end }}
</ul>
</ul>

0 comments on commit 6042968

Please sign in to comment.