blog_index_page.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {% extends "base.html" %}
  2. {% load wagtailcore_tags navigation_tags wagtailimages_tags %}
  3. {% block content %}
  4. {% include "base/include/header-index.html" %}
  5. <div class="container">
  6. {% if tag %}
  7. <div class="row">
  8. <div class="col-md-12">
  9. <p>Viewing all blog posts by <span class="outline">{{ tag }}</span></p>
  10. </div>
  11. </div>
  12. {% endif %}
  13. {% if page.get_child_tags %}
  14. <ul class="blog-tags tags list-inline">
  15. {% for tag in page.get_child_tags %}
  16. <li><a href="{{ tag.url }}">{{ tag }}</a></li>
  17. {% endfor %}
  18. </ul>
  19. {% endif %}
  20. <div class="row row-eq-height blog-list">
  21. {% if posts %}
  22. {% for blog in posts %}
  23. <li class="col-xs-12 col-sm-6 col-md-3 blog-list-item">
  24. <a href="{% pageurl blog %}">
  25. <div class="image">
  26. {% image blog.image fill-850x450-c50 as image %}
  27. <img src="{{ image.url }}" width="{{ image.width }}" height="{{ image.height }}" alt="{{ image.alt }}" class="" />
  28. </div>
  29. <div class="text">
  30. <h2 class="blog-list-title">{{ blog.title }}</h2>
  31. <p>{{ blog.introduction|truncatewords:15 }}</p>
  32. </div>
  33. <div class="small footer">
  34. {% if blog.date_published %}
  35. {{ blog.date_published }} by
  36. {% endif %}
  37. {% for author in blog.authors %}
  38. {{ author }}{% if not forloop.last %}, {% endif %}
  39. {% endfor %}
  40. </div>
  41. </a>
  42. </li>
  43. {% endfor %}
  44. {% else %}
  45. <div class="col-md-12">
  46. <p>Oh, snap. Looks like we were too busy baking to write any blog posts. Sorry.</p>
  47. </div>
  48. {% endif %}
  49. </div>
  50. </div>
  51. {% endblock content %}