Skip to content

Include only articles in the paginator #265

@briandfoy

Description

@briandfoy

In the _defaults/list.html template, we have a paginator like this (once my jQuery stuff lands):

    {{ range $index, $page := .Paginator.Pages }}
      {{ if not (isset $page.Params "exclude_paginate") }}
        {{ .Render "li" }}
      {{ end }}
    {{ end }}
    {{ partial "pagination.html" .Paginator }}

Previously this excluded about.md by name because it was the only special page.

Instead of iterating over all pages then looking at their params, l'd like to make the paginator from only those that we should include. I've introduced an "exclude_pagination" param, but that is probably stupid. It's good for now.

I think we really want something like this, which is not correct syntactically. We select all the pages to include, then paginate that list.

  {{ range $index, $page := .Paginate( (where .Params "Type" "is" "article").Pages) }}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions