Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination #12

Open
Pinjasaur opened this issue Apr 7, 2023 · 2 comments
Open

Pagination #12

Pinjasaur opened this issue Apr 7, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Pinjasaur
Copy link
Owner

Related to #10.

Supporting pagination would be a nice feature.

Some thoughts:

  • PER_PAGE as a envar config, default perhaps 10 and can scale indefinitely high for "no pagination"?
  • /page/{page} vs /pages/{page}?
  • Does the first page simply get mv-ed to index.html?
@Pinjasaur Pinjasaur added enhancement New feature or request help wanted Extra attention is needed labels Apr 7, 2023
@Pinjasaur
Copy link
Owner Author

Would need to consider how the templating would work too.

As inspiration, my blog looks like:

{{#pagination}}

<div style="text-align: center;">
  <small>
    {{#previous}}
    <a class="js-newer" href="/page/{{previous}}">&larr; Previous page</a>
    {{/previous}}
    {{#previous}}{{#next}}&nbsp;&bullet;&nbsp;{{/next}}{{/previous}}
    {{#next}}
    <a class="js-older" href="/page/{{next}}">Next page &rarr;</a>
    {{/next}}
  </small>
</div>

<hr>

<div style="text-align: center;">
  <small>Page {{current}} of {{total}}</small>
</div>

{{/pagination}}

https://github.com/Pinjasaur/blot-theme-jot/blob/fba89a39137a77b45b1c8b71e90672faa2ec003d/entries.html#L24-L44

@Pinjasaur
Copy link
Owner Author

cc @mfossen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant