mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add usage and intallation instructions
This commit is contained in:
parent
d2a28350ff
commit
2b933faaf2
1 changed files with 22 additions and 0 deletions
|
|
@ -5,7 +5,29 @@ Related posts plugin for Pelican
|
||||||
================================
|
================================
|
||||||
|
|
||||||
Adds related_posts variable to article's context
|
Adds related_posts variable to article's context
|
||||||
|
|
||||||
|
Settings
|
||||||
|
--------
|
||||||
|
To enable, add
|
||||||
|
|
||||||
|
from pelican.plugins import related_posts
|
||||||
|
PLUGINS = [related_posts]
|
||||||
|
|
||||||
|
to your settings.py.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
{% if article.related_posts %}
|
||||||
|
<ul>
|
||||||
|
{% for related_post in article.related_posts %}
|
||||||
|
<li>{{ related_post }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
related_posts = []
|
related_posts = []
|
||||||
def add_related_posts(generator, metadata):
|
def add_related_posts(generator, metadata):
|
||||||
if 'tags' in metadata:
|
if 'tags' in metadata:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue