flask-paginate
flask-paginate copied to clipboard
Missing rel attributes for links
I use flask_paginate 2022.01.08 with python 3.11
I think we could use (either by default or as an option) the rel
attributes with prev
and next
to improve semantics and also use the prefetch
attribute with next link, so it can accelerate the loading of next page when we click on the next link.
Here is the sample patch on version 2022.01.08
if I add the attributes next, prefetch for the next links.
53,54c53,54
< _bs = '<li class="next"><a href="{0}">{1}</a></li>'
< _bs33 = '<li><a href="{0}" aria-label="Next">\
---
> _bs = '<li class="next"><a href="{0}" rel="next prefetch">{1}</a></li>'
> _bs33 = '<li><a href="{0}" aria-label="Next" rel="next prefetch">\
57c57
< <a class="page-link" href="{0}" aria-label="Next">\
---
> <a class="page-link" href="{0}" aria-label="Next" rel="next prefetch">\
61c61
< <a class="page-link" href="{0}" aria-label="Next">\
---
> <a class="page-link" href="{0}" aria-label="Next" rel="next prefetch">\
63c63
< _bulma = '<a class="pagination-next" href={0} aria-label="Next">{1}</a>'
---
> _bulma = '<a class="pagination-next" href={0} aria-label="Next" rel="next prefetch">{1}</a>'
This sounds like a good idea, maybe a prev_rel
and next_rel
parameter will be added to customize it. How is your think?
I think it's a good idea, so I guess thoses would be boolean variables to activate/deactivate the feature ?
may be not boolean, like this next_rel="next prefetch"
, and default is next_rel=""
prefetch
seems not available for <a ...>...</a>
but for <link ....>...</link>
https://www.w3schools.com/tags/att_a_rel.asp
new version uploaded, you may try it.