feat: v2.21.0 paging for homepage, likes and admin dashboard
The homepage showed only the 20 newest notes and /likes the 50 newest, with no way back. The admin dashboard paged list_notes()'s default 50 newest, so it always said 'Page 1 of 2'. All three now count with count_notes() and fetch one page with limit/offset. Public pages get '<- Newer / Page N of M / Older ->' with rel=prev/next (h-feed paging), ?page=1 redirects to the bare URL, bad pages 404; the dashboard falls back to the nearest valid page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9074c9a08c
commit
615354d17e
11 files changed
+373
-60
No files matched your search
@@ -0,0 +1,15 @@
|
||||
{# Newer/older links for paged public lists (v2.21.0). Page 1 is the bare
|
||||
URL. rel=prev/next let IndieWeb readers page through the h-feed. #}
|
||||
{% macro pager(endpoint, page, total_pages) %}
|
||||
{% if total_pages > 1 %}
|
||||
<nav class="pager" aria-label="More notes">
|
||||
{% if page > 1 %}
|
||||
<a rel="prev" href="{{ url_for(endpoint, page=page - 1) if page > 2 else url_for(endpoint) }}">← Newer</a>
|
||||
{% endif %}
|
||||
<span class="pager-position">Page {{ page }} of {{ total_pages }}</span>
|
||||
{% if page < total_pages %}
|
||||
<a rel="next" href="{{ url_for(endpoint, page=page + 1) }}">Older →</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
Reference in new issue
Block a user