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 #253
  • Loading branch information
mmistakes committed Jul 11, 2016
1 parent 690f111 commit dfa94b8
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 dfa94b8

Please sign in to comment.