Skip to content

Commit

Permalink
Indicate the relationship between component URLs in a paginated series
Browse files Browse the repository at this point in the history
- Apply rel="prev" and rel="next" to pages that use site.paginator
- Ref ~> https://webmasters.googleblog.com/2011/09/pagination-with-relnext-and-relprev.html
- Close mmistakes#253
  • Loading branch information
mmistakes authored and sobkowiak committed Jul 18, 2016
1 parent 49ee5e4 commit b5d7af9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions _includes/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@
{% if page.date %}
<meta property="og:type" content="article">
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
{% if page.next.url %}
<link rel="next" href="{{ page.next.url | prepend: seo_url | replace: "/index.html", "/" }}" title="{{ page.next.title | escape }}">
{% endif %}
{% if page.previous.url %}
<link rel="prev" href="{{ page.previous.url | prepend: seo_url | replace: "/index.html", "/" }}" title="{{ page.previous.title | escape }}">
{% endif %}
{% endif %}

{% if paginator.previous_page %}
<link rel="prev" href="{{ paginator.previous_page_path | prepend: seo_url }}">
{% endif %}
{% if paginator.next_page %}
<link rel="next" href="{{ paginator.next_page_path | prepend: seo_url }}">
{% endif %}

{% if site.og_image %}
Expand Down

0 comments on commit b5d7af9

Please sign in to comment.