原始鹈鹕系列插件的可安装版本

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文档,从贡献代码部分开始。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
从PHP代码调用使用Axis创建的Java web服务   java空白“存储库视图”,带有新的EclipseRCP4.16和EGIT5.8   java我可以通过hadoop中的代码提前完成映射任务吗?   java将ZoneDateTime从Dropwizard保存到MySQL时出现问题   java如何在方法中返回中断或继续?   java如何在JAXWS客户机上指定客户机证书和客户机证书身份验证   java IOException:权限被拒绝   如何在Java中处理XML从XML数据库检索数据   java删除数组列表中的第二个元素   未注册java方案“ttps”   如何使用Selenium和Java从自动建议中选择选项?   java8可选如何正确使用它?   java存储过程无法从Hibernate调用   java为什么惰性抓取不起作用JPA   java如何从多个图像选择可用条件中划分一个图像选择案例?   java将数组定义为类变量,用户输入维度   java截图例外:截图已拍摄   非常简单的Android应用程序中的java内存泄漏   java facebook是否要求可信应用程序的身份验证?