Add support for the neighbors plugin (#98)
This commit is contained in:
parent
212f106a55
commit
a6f12ec781
5 changed files with 27 additions and 4 deletions
|
@ -38,6 +38,7 @@ DON'T send any questions, issues or anything related to Flex to my personal emai
|
||||||
- [Minute read](https://github.com/getpelican/pelican-plugins/tree/master/post_stats)) (new in 2.0)
|
- [Minute read](https://github.com/getpelican/pelican-plugins/tree/master/post_stats)) (new in 2.0)
|
||||||
- [Related Posts](https://github.com/getpelican/pelican-plugins/tree/master/related_posts)
|
- [Related Posts](https://github.com/getpelican/pelican-plugins/tree/master/related_posts)
|
||||||
- [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image) (new in 2.2)
|
- [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image) (new in 2.2)
|
||||||
|
- [Neighbors](https://github.com/getpelican/pelican-plugins/tree/master/neighbors) (new in 2.2)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,11 @@ main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.neighbors {
|
||||||
|
margin: 4% 0% 4% 0%;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
margin: 4% 8% 4% 8%;
|
margin: 4% 8% 4% 8%;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|
|
@ -57,6 +57,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>
|
||||||
|
|
14
templates/partial/neighbors.html
Normal file
14
templates/partial/neighbors.html
Normal 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 %}
|
|
@ -3,10 +3,13 @@
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
# Optional 'neighbors' plugin adds previous/next post buttons to articles.
|
||||||
PLUGIN_PATHS = ['../plugins']
|
PLUGIN_PATHS = ['../plugins']
|
||||||
PLUGINS = ['i18n_subsites']
|
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,
|
||||||
|
|
Loading…
Reference in a new issue