Skip to content

Pagination implies you've already reached the end #34

@textbook

Description

@textbook

When you look at a paginated view of the articles (e.g. tag page), it always looks like you've reached the end because the articles don't fill up the space available.

This is due to a combination of:

  • the DEFAULT_PAGINATION = 5 setting on the example blog, the documentation should recommend a multiple of 6 be used (to neatly fit the 3 -> 2 -> 1 responsive layout); and
  • on the first page (arguably the worst place to imply you've reached the end!) one article is taken out to be the larger preview.

The latter is handled by:

{% if articles and not articles_page.has_previous() %}
{% with article = articles[0] %}
<aside id="featured" class="body">
<article>
<h1 class="title">
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
</h1>
{% include 'article_infos.html' %}
<div class="section">
{% if BULRUSH_SHOW_SUMMARY %}
{{ article.summary }}
<p><a href="{{ SITEURL }}/{{ article.url }}">Read more...</a></p>
{% else %}
{{ article.content }}
{% endif %}
{% include 'comments.html' %}
</div>
</article>
</aside>
{% endwith %}
{% with article_list = articles_page.object_list[1:] %}
{% include 'article_list.html' %}
{% endwith %}
{% else %}
{% with article_list = articles_page.object_list %}
{% include 'article_list.html' %}
{% endwith %}
{% endif %}

I'm not sure of the best way to do that - the page sizes are always going to be consistent, I don't see a way to say "x + 1 for the first page and x thereafter" - that leaves either repeating the first item (once in the preview, once in the list) or simply omitting the expanded preview entirely.

First page

Screenshot 2021-07-23 at 11 39 59

Nth page

Screenshot 2021-07-23 at 11 40 08

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions