Skip to content

Commit 0006c3e

Browse files
Merge pull request #290 from fghaas/tox-plus-series
Support the Series plugin
2 parents 3b11bc9 + 20725c8 commit 0006c3e

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Pelican test
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version:
11+
- 3.6
12+
- 3.7
13+
- 3.8
14+
- 3.9
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
submodules: true
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
pip install tox tox-gh-actions
27+
- name: Test with tox
28+
run: tox

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme.
1717
- Open Graph
1818
- Rich Snippets (JSON-LD)
1919
- Related Posts (via [plugin](https://github.com/getpelican/pelican-plugins/tree/master/related_posts) or AddThis)
20+
- Series (via [plugin](https://github.com/pelican-plugins/series))
2021
- Minute read (via [plugin](https://github.com/getpelican/pelican-plugins/tree/master/post_stats))
2122
- [Multiple Code Highlight Styles](https://github.com/alexandrevicenzi/Flex/wiki/Code-Highlight)
2223
- [Translation Support](https://github.com/alexandrevicenzi/Flex/wiki/Translations)
@@ -41,6 +42,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme.
4142
- [I18N Sub-sites](https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites)
4243
- [Minute read](https://github.com/getpelican/pelican-plugins/tree/master/post_stats)
4344
- [Related Posts](https://github.com/getpelican/pelican-plugins/tree/master/related_posts)
45+
- [Series](https://github.com/pelican-plugins/series)
4446
- [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image)
4547
- [Neighbors](https://github.com/getpelican/pelican-plugins/tree/master/neighbors)
4648
- [Pelican Search](https://github.com/pelican-plugins/search)

templates/article.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,29 @@ <h4>{{ _('You might enjoy') }}</h4>
8383
<div class="addthis_relatedposts_inline"></div>
8484
{% endif %}
8585

86+
{% if article.series %}
87+
<div class="related-posts">
88+
{% set text = SERIES_TEXT|default('Part %(index)s of the %(name)s series') %}
89+
<h4>{{ text|format(index=article.series.index, name=article.series.name) }}</h4>
90+
{% if article.series.all_previous %}
91+
<h5>Previous articles</h5>
92+
<ul>
93+
{% for article in article.series.all_previous %}
94+
<li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li>
95+
{% endfor %}
96+
</ul>
97+
{% endif %}
98+
{% if article.series.all_next %}
99+
<h5>Next articles</h5>
100+
<ul>
101+
{% for article in article.series.all_next %}
102+
<li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li>
103+
{% endfor %}
104+
</ul>
105+
{% endif %}
106+
</div>
107+
{% endif %}
108+
86109
{% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.article_bottom %}
87110
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
88111
<ins class="adsbygoogle ads-responsive"

tox.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[tox]
2+
envlist = py{36,37,38,39}
3+
skipsdist = True
4+
5+
[gh-actions]
6+
python =
7+
3.6: py36
8+
3.7: py37
9+
3.8: py38
10+
3.9: py39
11+
12+
[testenv]
13+
deps =
14+
-r docs/requirements.txt
15+
commands =
16+
pelican -s docs/pelicanconf.py

0 commit comments

Comments
 (0)