原始鹈鹕系列插件的可安装版本
pelican-series-plugin的Python项目详细描述
鹈鹕系列:鹈鹕的插件
此插件扩展了原始系列插件FELD Boris lothiraldan@gmail.com 版权所有Leonardo Giordani giordani.leonardo@gmail.com 此插件也位于Pelican Plugins repository
series插件允许您将不同的帖子加入到一个系列中。在
要将帖子标记为系列的一部分,请使用:series:
元数据:
:series: NAME_OF_THIS_SERIES
或者,在降价语法中
^{pr2}$该插件收集属于同一系列的所有文章并提供 可以在模板中使用的系列相关变量。在
索引
默认情况下,一个系列中的文章按日期排序,然后自动编号。在
如果要强制给定的顺序,只需指定:series_index:
元数据或在Markdown series_index:
中指定,
从1开始。所有文章的开头都加上了索引
序列并根据索引本身排序。所有剩余物品
跟在他们后面,按日期点菜。在
该插件为模板提供以下变量
* `article.series.name` is the name of the series as specified in the article metadata
* `article.series.index` is the index of the current article inside the series
* `article.series.all` is an ordered list of all articles in the series (including the current one)
* `article.series.all_previous` is an ordered list of the articles published before the current one
* `article.series.all_next` is an ordered list of the articles published after the current one
* `article.series.previous` is the previous article in the series (a shortcut to `article.series.all_previous[-1]`)
* `article.series.next` is the next article in the series (a shortcut to `article.series.all_next[0]`)
例如:
{% if article.series %}
<p>This post is part {{ article.series.index }} of the "{{ article.series.name }}" series:</p>
<ol class="parts">
{% for part_article in article.series.all %}
<li {% if part_article == article %}class="active"{% endif %}>
<a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a>
</li>
{% endfor %}
</ol>
{% endif %}
联接系列中的文章,并提供在模板中管理该系列的变量。在
安装
此插件可以通过以下方式安装:
pip install pelican-series-plugin
接下来将其添加到PLUGINS
部分中的pelicanconf.py
PLUGINS=['...','pelican.plugins.series','...']
贡献
我们欢迎并非常感谢您的贡献。每一点帮助。您可以通过改进文档、添加缺少的功能和修复错误来做出贡献。您也可以通过查看和评论existing issues来帮助您。在
要开始对此插件作出贡献,请查看Contributing to Pelican文档,从贡献代码部分开始。在
- 项目
标签: