原始Pelican Series插件的安装版本
项目描述
Pelican Series: Pelican的插件
This plugin extends the original series plugin by FELD Boris lothiraldan@gmail.com 版权所有 (c) Leonardo Giordani giordani.leonardo@gmail.com 此插件也位于 Pelican 插件仓库
此系列插件允许您将不同的帖子组合成一个系列。
为了将帖子标记为系列的一部分,请使用 :series:
元数据
:series: NAME_OF_THIS_SERIES
或者,在 Markdown 语法中
Series: NAME_OF_THIS_SERIES
插件会收集属于同一系列的所有文章,并提供可用于模板中的系列相关变量。
索引
默认情况下,系列中的文章按日期排序,然后自动编号。
如果您想强制给定顺序,请指定 :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]`)
* `article.series.first` is the first article in the series
* `article.series.last` is the last article in the series
例如
{% 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
接下来,将其添加到 pelicanconf.py
中的 PLUGINS
部分
PLUGINS = [
'...',
'pelican.plugins.series',
'...'
]
贡献
欢迎并非常感谢贡献。每一份努力都很有帮助。您可以通过改进文档、添加缺失功能以及修复错误来贡献。您还可以通过审查和评论 现有问题 来提供帮助。
要开始为此插件做出贡献,请查看 向 Pelican 贡献 文档,从 向代码贡献 部分开始。
项目详情
下载文件
下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分布
pelican-series-plugin-1.1.1.tar.gz (4.4 kB 查看散列值)
构建分布
关闭
pelican-series-plugin-1.1.1.tar.gz 的散列值
算法 | 散列摘要 | |
---|---|---|
SHA256 | b5016021f934e39e8051c413bc2833e94e293d797d35bcb8588cd2a6fc642c28 |
|
MD5 | cf8cf66bc3eee2fe1d7c207a1418b1a6 |
|
BLAKE2b-256 | cfe87980a082b4746f8da68f8aff338dba8638843ff3df6453ab69d4befc35f7 |
关闭
pelican_series_plugin-1.1.1-py3-none-any.whl 的散列值
算法 | 散列摘要 | |
---|---|---|
SHA256 | 37e212a9c3c890c3930a769d45b2293cd845018f841a492b52055b7a139b4c89 |
|
MD5 | 880322e6e1b5c93c5bf956428d6a9337 |
|
BLAKE2b-256 | 53aa2672ff25b0bd26118c49f2c25729df5925ef89b6a54e550ff529a79cde8a |