postlistitem.twig.example 1.8 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {% spaceless %}<article class="list">
  2. <a id=nounderline href="{{ page.url }}">
  3. <h1>{{ page.title|replace({'-':'‑'}) }}</h1>{# the replacement is a non-breaking hyphen #}
  4. {% if page.meta.description is not empty %}
  5. <p class="description">{{ page.meta.description }}</p>
  6. {% endif %}
  7. </a>
  8. <aside class="clearfix">
  9. {% if page.meta.date is not empty %}
  10. <span class="date">{{ page.meta.date_formatted }}
  11. {% if page.meta.timeline is not empty %}
  12. <span class="timeline">
  13. {% for date in page.meta.timeline|split(',') %}
  14. - {{ date|date("M d Y") }}
  15. {% endfor %}
  16. </span>
  17. {% endif %}
  18. </span>
  19. {% endif %}
  20. {% if page.meta.author is not empty %}
  21. <span class="author">by <a href="/authors?q={{ page.meta.author }}">{{ page.meta.author }}</a></span>
  22. {% endif %}
  23. {% for tag in page.meta.tags|split(',') %}
  24. <a class="tag" href="/tags?q={{ tag }}">#{{ tag }}</a>
  25. {% endfor %}
  26. </aside>
  27. {% if config.tagblog.excerpt %}
  28. {# Alternative method that cuts at word boundaries, counting 50 words #}
  29. {#<p class="excerpt">{% if page.meta.excerpt is not empty %}{{ page.meta.excerpt }}{% else %}{% set excerpt = page.id|content|striptags|split(' ') %}{% for i in 0..50 %}{{ excerpt[i]|raw }} {% endfor %}{% endif %}...</p>#}
  30. {# Simple method, slicing off the first 300 characters #}
  31. {% if page.meta.excerpt is not empty %}<div class="excerpt"><p>{{ page.meta.excerpt }}</p></div>{% elseif config.tagblog.excerpt_length > 0 %}<div class="excerpt"><p>{{ page.id|content|striptags|slice(0,config.tagblog.excerpt_length) }}{{ config.tagblog.excerpt_terminator }}</p></div>{% endif %}
  32. {% endif %}
  33. </article>
  34. {% endspaceless %}