getpelican/pelican — pull request #691 by webdesignhero (2013-01-20 23:29:04+00:00)
Title: Related Post Plugin Example

The existing related posts example doesn't show properties for the collection, this could be confusing to individuals who are not programmers, because as it was the code would render five bullet points.

I am also looking to add some type of loop control or if statement to the loop to detect duplicate, I tried t a dictionary sort filter through jinja, bu that through an error, the following is not guarantted to work then:

{% set LASTARTICLE = "notset" %}
{% if article.related_posts %}

{% for related_post in article.related_posts|dictsort(false, 'url') %}
{% if not (LASTARTICLE == related_post.url) %}

{{ related_post.title }}

{% endif %}
{% set LASTARTICLE = related_post.url %}
{% endfor %}

{% endif %}

the dicsort does not work (is this not a dict, I'm not a python guy so I'm just hacking at it.)