related_posts.html 741 B

1234567891011121314151617181920
  1. {% if article.related_posts %}
  2. {% from '_includes/_defaults.html' import RELATED_POSTS_LABEL with context %}
  3. <section>
  4. <h2>{{ RELATED_POSTS_LABEL }}</h2>
  5. <ul class="related-posts-list">
  6. {% for related_post in article.related_posts|sort(attribute = 'date') %}
  7. {% set v_title = related_post.title|striptags %}
  8. {% set title = related_post.title|striptags|e %}
  9. {%if related_post.subtitle %}
  10. {% set title = title + ' - ' + related_post.subtitle|striptags|e %}
  11. {% set v_title = v_title + ' ' + '<small>' + related_post.subtitle|striptags + '</small>' %}
  12. {% endif %}
  13. <li><a href="{{ SITEURL }}/{{ related_post.url }}" title="{{ title }}">{{ v_title }}</a></li>
  14. {% endfor %}
  15. </ul>
  16. <hr />
  17. </section>
  18. {% endif %}