blog_item.html.twig 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <div class="list-item">
  2. {% set header_image = page.header.header_image|defined(true) %}
  3. {% set header_image_width = page.header.header_image_width|defined(900) %}
  4. {% set header_image_height = page.header.header_image_height|defined(300) %}
  5. {% set header_image_file = page.header.header_image_file %}
  6. <div class="list-blog-header">
  7. <span class="list-blog-date">
  8. <span>{{ page.date|date("d") }}</span>
  9. <em>{{ page.date|date("M") }}</em>
  10. </span>
  11. {% if page.header.link %}
  12. <h4>
  13. {% if page.header.continue_link is not sameas(false) %}
  14. <a href="{{ page.url }}"><i class="fa fa-angle-double-right"></i></a>
  15. {% endif %}
  16. <a href="{{ page.header.link }}">{{ page.title }}</a>
  17. </h4>
  18. {% else %}
  19. <h4><a href="{{ page.url }}">{{ page.title }}</a></h4>
  20. {% endif %}
  21. {% if page.taxonomy.tag %}
  22. <span class="tags">
  23. {% for tag in page.taxonomy.tag %}
  24. <a href="{{ blog.url }}/tag{{ config.system.param_sep }}{{ tag }}">{{ tag }}</a>
  25. {% endfor %}
  26. </span>
  27. {% endif %}
  28. {% if header_image %}
  29. {% if header_image_file %}
  30. {% set header_image_media = page.media.images[header_image_file] %}
  31. {% else %}
  32. {% set header_image_media = page.media.images|first %}
  33. {% endif %}
  34. {{ header_image_media.cropZoom(header_image_width, header_image_height).html }}
  35. {% endif %}
  36. </div>
  37. <div class="list-blog-padding">
  38. {% if page.header.continue_link is sameas(false) %}
  39. {{ page.content }}
  40. {% if not truncate %}
  41. {% set show_prev_next = true %}
  42. {% endif %}
  43. {% elseif truncate and page.summary != page.content %}
  44. {{ page.summary }}
  45. <p><a href="{{ page.url }}">Continue Reading...</a></p>
  46. {% elseif truncate %}
  47. {% if page.summary != page.content %}
  48. {{ page.content|truncate(550) }}
  49. {% else %}
  50. {{ page.content }}
  51. {% endif %}
  52. <p><a href="{{ page.url }}">Continue Reading...</a></p>
  53. {% else %}
  54. {{ page.content }}
  55. {% set show_prev_next = true %}
  56. {% endif %}
  57. {% if show_prev_next %}
  58. <p class="prev-next">
  59. {% if not page.isFirst %}
  60. <a class="button" href="{{ page.nextSibling.url }}"><i class="fa fa-chevron-left"></i> Next Post</a>
  61. {% endif %}
  62. {% if not page.isLast %}
  63. <a class="button" href="{{ page.prevSibling.url }}">Previous Post <i class="fa fa-chevron-right"></i></a>
  64. {% endif %}
  65. </p>
  66. {% endif %}
  67. </div>
  68. </div>