blog_item.html.twig 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <div class="list-item h-entry">
  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. <time class="dt-published" datetime="{{ page.date|date("c") }}">
  9. <span>{{ page.date|date("d") }}</span>
  10. <em>{{ page.date|date("M") }}</em>
  11. </time>
  12. </span>
  13. {% if page.header.link %}
  14. <h4 class="p-name">
  15. {% if page.header.continue_link is not same as(false) %}
  16. <a href="{{ page.url }}"><i class="fa fa-angle-double-right u-url"></i></a>
  17. {% endif %}
  18. <a href="{{ page.header.link }}" class="u-url">{{ page.title }}</a>
  19. </h4>
  20. {% else %}
  21. <h4 class="p-name"><a href="{{ page.url }}" class="u-url">{{ page.title }}</a></h4>
  22. {% endif %}
  23. {% if page.taxonomy.tag %}
  24. <span class="tags">
  25. {% for tag in page.taxonomy.tag %}
  26. <a href="{{ blog.url|rtrim('/') }}/tag{{ config.system.param_sep }}{{ tag }}" class="p-category">{{ tag }}</a>
  27. {% endfor %}
  28. </span>
  29. {% endif %}
  30. {% if header_image %}
  31. {% if header_image_file %}
  32. {% set header_image_media = page.media.images[header_image_file] %}
  33. {% else %}
  34. {% set header_image_media = page.media.images|first %}
  35. {% endif %}
  36. {{ header_image_media.cropZoom(header_image_width, header_image_height).html|raw }}
  37. {% endif %}
  38. </div>
  39. <div class="list-blog-padding">
  40. {% if page.header.continue_link is same as(false) %}
  41. <div class="e-content">
  42. {{ page.content|raw }}
  43. </div>
  44. {% if not truncate %}
  45. {% set show_prev_next = true %}
  46. {% endif %}
  47. {% elseif truncate and page.summary != page.content %}
  48. <div class="p-summary e-content">
  49. {{ page.summary|raw }}
  50. <p><a href="{{ page.url }}">{{ 'BLOG.ITEM.CONTINUE_READING'|t }}</a></p>
  51. </div>
  52. {% elseif truncate %}
  53. <div class="p-summary e-content">
  54. {{ page.content|raw }}
  55. <p><a href="{{ page.url }}">{{ 'BLOG.ITEM.CONTINUE_READING'|t }}</a></p>
  56. </div>
  57. {% else %}
  58. <div class="e-content">
  59. {{ page.content|raw }}
  60. </div>
  61. {% if config.plugins.comments.enabled %}
  62. {% include 'partials/comments.html.twig' %}
  63. {% endif %}
  64. {% set show_prev_next = true %}
  65. {% endif %}
  66. {% if show_prev_next %}
  67. <p class="prev-next">
  68. {% if not page.isFirst %}
  69. <a class="button" href="{{ page.nextSibling.url }}"><i class="fa fa-chevron-left"></i> {{ 'BLOG.ITEM.NEXT_POST'|t }}</a>
  70. {% endif %}
  71. {% if not page.isLast %}
  72. <a class="button" href="{{ page.prevSibling.url }}">{{ 'BLOG.ITEM.PREV_POST'|t }} <i class="fa fa-chevron-right"></i></a>
  73. {% endif %}
  74. </p>
  75. {% endif %}
  76. </div>
  77. </div>