Browse Source

Fix inclusion of other page types under "latest posts"

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".
master
digitalcraftsman 8 years ago
parent
commit
60429682f7
  1. 6
      layouts/partials/latest-posts.html

6
layouts/partials/latest-posts.html

@ -1,6 +1,8 @@
<ul id="post-list" class="archive readmore"> <ul id="post-list" class="archive readmore">
<h3>{{ with .Site.Params.readMore }}{{ . }}{{ else }}Read more{{ end }}</h3> <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 "" }} {{ $url := replace .Permalink .Site.BaseURL "" }}
{{ if and (ne $url "about/") }} {{ if and (ne $url "about/") }}
<li> <li>
@ -8,4 +10,4 @@
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}
</ul>
</ul>
Loading…
Cancel
Save