diff mbox

[archweb] Add “rel” attribute to pagination links

Message ID 20181007190126.9413-1-olli@suruatoel.xyz
State New
Headers show

Commit Message

Olli Oct. 7, 2018, 7:01 p.m. UTC
Add the “rel” attribute for “prev” and “next” to the pagination links
of news and packages.
---
 templates/news/paginator.html            | 4 ++--
 templates/packages/search_paginator.html | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Jelle van der Waa Oct. 21, 2018, 1:10 p.m. UTC | #1
On 10/07/18 at 09:01pm, coderkun wrote:
> Add the “rel” attribute for “prev” and “next” to the pagination links
> of news and packages.

Interesting patch, but does any browser even care about these rel tags
these days? A quick search didn't seem to show it's very useful.

> ---
>  templates/news/paginator.html            | 4 ++--
>  templates/packages/search_paginator.html | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/templates/news/paginator.html b/templates/news/paginator.html
> index 57fbeb1..524c666 100644
> --- a/templates/news/paginator.html
> +++ b/templates/news/paginator.html
> @@ -4,7 +4,7 @@
>      <p class="news-nav">
>      {% if page_obj.has_previous %}
>      <a class="prev" href="?page={{ page_obj.previous_page_number }}"
> -        title="Go to previous page">&lt; Prev</a>
> +        title="Go to previous page" rel="prev">&lt; Prev</a>
>      {% endif %}
>      {% for num in paginator.page_range %}
>      {% ifequal num page_obj.number %}
> @@ -15,7 +15,7 @@
>      {% endfor %}
>      {% if page_obj.has_next %}
>      <a class="next" href="?page={{ page_obj.next_page_number }}"
> -        title="Go to next page">Next &gt;</a>
> +        title="Go to next page" rel="next">Next &gt;</a>
>      {% endif %}
>      </p>
>  </div>
> diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html
> index a748d26..a676626 100644
> --- a/templates/packages/search_paginator.html
> +++ b/templates/packages/search_paginator.html
> @@ -7,7 +7,7 @@
>      <span class="prev">
>          {% if page_obj.has_previous %}
>          <a href="?page={{ page_obj.previous_page_number }}&amp;{{ current_query }}"
> -            title="Go to previous page">&lt; Prev</a>
> +            title="Go to previous page" rel="prev">&lt; Prev</a>
>          {% else %}
>          &lt; Prev
>          {% endif %}
> @@ -15,7 +15,7 @@
>      <span class="next">
>          {% if page_obj.has_next %}
>          <a href="?page={{ page_obj.next_page_number }}&amp;{{ current_query }}"
> -            title="Go to next page">Next &gt;</a>
> +            title="Go to next page" rel="next">Next &gt;</a>
>          {% else %}
>          Next &gt;
>          {% endif %}
> -- 
> 2.19.1
Olli Oct. 21, 2018, 3:08 p.m. UTC | #2
On 21.10.18 15:10, Jelle van der Waa wrote:
> On 10/07/18 at 09:01pm, coderkun wrote:
> > Add the “rel” attribute for “prev” and “next” to the pagination
> > links of news and packages.
> 
> Interesting patch, but does any browser even care about these rel tags
> these days? A quick search didn't seem to show it's very useful.

Qutebrowser does support navigation based on the rel attributes:
https://qutebrowser.org/doc/help/commands.html#navigate

Additionally I would consider it as good practice to properly markup
links when possible.

Thanks for your feedback,
Olli
diff mbox

Patch

diff --git a/templates/news/paginator.html b/templates/news/paginator.html
index 57fbeb1..524c666 100644
--- a/templates/news/paginator.html
+++ b/templates/news/paginator.html
@@ -4,7 +4,7 @@ 
     <p class="news-nav">
     {% if page_obj.has_previous %}
     <a class="prev" href="?page={{ page_obj.previous_page_number }}"
-        title="Go to previous page">&lt; Prev</a>
+        title="Go to previous page" rel="prev">&lt; Prev</a>
     {% endif %}
     {% for num in paginator.page_range %}
     {% ifequal num page_obj.number %}
@@ -15,7 +15,7 @@ 
     {% endfor %}
     {% if page_obj.has_next %}
     <a class="next" href="?page={{ page_obj.next_page_number }}"
-        title="Go to next page">Next &gt;</a>
+        title="Go to next page" rel="next">Next &gt;</a>
     {% endif %}
     </p>
 </div>
diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html
index a748d26..a676626 100644
--- a/templates/packages/search_paginator.html
+++ b/templates/packages/search_paginator.html
@@ -7,7 +7,7 @@ 
     <span class="prev">
         {% if page_obj.has_previous %}
         <a href="?page={{ page_obj.previous_page_number }}&amp;{{ current_query }}"
-            title="Go to previous page">&lt; Prev</a>
+            title="Go to previous page" rel="prev">&lt; Prev</a>
         {% else %}
         &lt; Prev
         {% endif %}
@@ -15,7 +15,7 @@ 
     <span class="next">
         {% if page_obj.has_next %}
         <a href="?page={{ page_obj.next_page_number }}&amp;{{ current_query }}"
-            title="Go to next page">Next &gt;</a>
+            title="Go to next page" rel="next">Next &gt;</a>
         {% else %}
         Next &gt;
         {% endif %}