Different philosophy for rel prev/next links based on recommendations from Google.

Details here: https://webmasters.googleblog.com/2011/09/pagination-with-relnext-and-relprev.html.

This replaces the per-page prev/next links with general ones that will be output whenever there is a paginator with a previous or next page to show.
This commit is contained in:
Todd Eichel 2016-05-11 15:02:07 -07:00
parent ddb96a01ca
commit 220901c140
No known key found for this signature in database
GPG Key ID: F9BFFDFEC16FD5E9
3 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,7 @@ Jekyll SEO Tag adds the following meta tags to your site:
* Pages title (with site title appended when available)
* Page description
* Canonical URL
* Next and previous URLs for posts
* Next and previous URLs on paginated pages
* [JSON-LD Site and post metadata](https://developers.google.com/structured-data/) for richer indexing
* [Open graph](http://ogp.me/) title, description, site title, and URL (for Facebook, LinkedIn, etc.)
* [Twitter summary card](https://dev.twitter.com/cards/overview) metadata

View File

@ -30,6 +30,7 @@ module Jekyll
{
'page' => context.registers[:page],
'site' => context.registers[:site].site_payload['site'],
'paginator' => context['paginator'],
'seo_tag' => options
}
end

View File

@ -139,14 +139,13 @@
{% if page.date %}
<meta property="og:type" content="article" />
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
{% endif %}
{% 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 %}
{% 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.twitter %}