Browse Source

fix list page filtering not working

When I started using the blank theme, I found urls like /tags/js would list all posts instead of just posts tagged 'js'. Changing '.Site.Pages' to 'Data.Pages' fixes this, and now my site can have lists that filter posts by category and tags.
main
Adam Sullovey 4 years ago
parent
commit
8c4df57d4f
  1. 4
      layouts/_default/list.html

4
layouts/_default/list.html

@ -1,10 +1,10 @@
{{ partial "header.html" . }}
<main>
{{ $paginator := .Paginate (where .Site.Pages "Type" "post") }}
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $paginator.Pages }}
{{ partial "summary.html" . }}
{{ end }}
{{ partial "pagination.html" . }}
</main>
{{ partial "sidebar.html" . }}
{{ partial "footer.html" . }}
{{ partial "footer.html" . }}

Loading…
Cancel
Save