Update `site.gems` references to `site.plugins` (#39)

* Update `site.gems` references to `site.plugins`

Fixes checks to determine if jekyll-seo-tag and jekyll-feed are active.

Related to #24

* Add `site.gems` checks for backwards compatibility

Check both `site.gems` and `site.plugins` when determining if plugins are active.
Allows compatibility with Jekyll versions prior to 3.5.0.

Related to #24
This commit is contained in:
Tony Ho 2017-12-15 03:19:11 +11:00 committed by Michael Rose
parent 5c9db097a3
commit afb6060a25
3 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@
{% endif %}
<li>
{% if site.plugins contains 'jekyll-feed' %}
{% if site.plugins contains 'jekyll-feed' or site.gems contains 'jekyll-feed' %}
<a href="{{ site.feed.path | default: 'feed.xml' | relative_url }}" title="Atom Feed">
<span class="icon icon--rss">{% include icon-rss.svg %}</span>
<span class="label">{{ site.data.theme.t.subscribe | default: 'Subscribe' }}</span>

View File

@ -3,7 +3,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% if site.gems contains 'jekyll-seo-tag' %}
{% if site.plugins contains 'jekyll-seo-tag' or site.gems contains 'jekyll-seo-tag' %}
{% comment %}
Add metadata for search engines and social networks if jekyll-seo-tag plugin is enabled
{% endcomment %}
@ -26,7 +26,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family={% for font in site.data.theme.google_fonts %}{{ font.name | replace: ' ', '+' }}{% if font.weights %}:{% endif %}{{ font.weights | remove: ' ' }}{% if forloop.last != true %}|{% endif %}{% endfor %}">
{% endif %}
{% if site.gems contains 'jekyll-feed' %}
{% if site.plugins contains 'jekyll-feed' or site.gems contains 'jekyll-feed'%}
{% comment %}
Add Atom feed link if jekyll-feed plugin is enabled
{% endcomment %}

View File

@ -13,7 +13,7 @@ layout: default
<h2>{{ site.data.theme.t.posts | default: 'Posts' }}{% if paginator.page > 1 %}{{ site.data.theme.t.page | default: 'Page' | prepend: ' - ' | append: ' ' }}{{ paginator.page }} {{ site.data.theme.t.of | default: 'of' }} {{ paginator.total_pages }}{% endif %}</h2>
</header>
<div class="entries">
{% if site.plugins contains 'jekyll-paginate' and page.paginate %}
{% if site.plugins contains 'jekyll-paginate' and page.paginate or site.gems contains 'jekyll-paginate' and page.paginate %}
{% comment %}
Add paginator.posts loop if jekyll-paginate plugin is enabled
and page.paginate == true