Add support for the neighbors plugin

This commit is contained in:
olipratt 2017-03-04 12:14:29 +00:00
parent 772035ea96
commit 39c93b218d
4 changed files with 23 additions and 6 deletions

View file

@ -133,7 +133,7 @@ main {
} }
} }
.pagination { .pagination, .neighbors {
margin: 4% 8% 4% 8%; margin: 4% 8% 4% 8%;
height: 20px; height: 20px;
} }

View file

@ -56,6 +56,8 @@
</div> </div>
{% endif %} {% endif %}
{% include "partial/neighbors.html" %}
{% if article.related_posts %} {% if article.related_posts %}
<div class="related-posts"> <div class="related-posts">
<h4>{{ _('You might enjoy') }}</h4> <h4>{{ _('You might enjoy') }}</h4>

View file

@ -0,0 +1,14 @@
{% if 'neighbors' in PLUGINS %}
<div class="neighbors">
{% if article.prev_article %}
<a class="btn float-left" href="{{ SITEURL }}/{{ article.prev_article.url }}" title="{{ article.prev_article.title }}">
<i class="fa fa-angle-left"></i> {{ _('Previous Post') }}
</a>
{% endif %}
{% if article.next_article %}
<a class="btn float-right" href="{{ SITEURL }}/{{ article.next_article.url }}" title="{{ article.next_article.title }}">
{{ _('Next Post') }} <i class="fa fa-angle-right"></i>
</a>
{% endif %}
</div>
{% endif %}

View file

@ -3,10 +3,13 @@
from __future__ import unicode_literals from __future__ import unicode_literals
PLUGIN_PATHS = ['../plugins'] # Optional 'neighbors' plugin adds previous/next post buttons to articles.
PLUGINS = ['i18n_subsites'] PLUGIN_PATHS = ['../../pelican-plugins']
PLUGINS = ['i18n_subsites', 'neighbors']
JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n', 'jinja2.ext.autoescape', 'jinja2.ext.with_']} JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n',
'jinja2.ext.autoescape',
'jinja2.ext.with_']}
AUTHOR = u'Test' AUTHOR = u'Test'
SITEURL = u'http://localhost:8000' SITEURL = u'http://localhost:8000'
@ -54,8 +57,6 @@ CC_LICENSE = {
COPYRIGHT_YEAR = 2016 COPYRIGHT_YEAR = 2016
DEFAULT_PAGINATION = 10
STATUSCAKE = { STATUSCAKE = {
'trackid': 'test-test', 'trackid': 'test-test',
'days': 7, 'days': 7,