blog.html.twig 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {% extends 'partials/base.html.twig' %}
  2. {% set blog_image = page.media.images[page.header.hero_image] ?: page.media.images|first %}
  3. {% set collection = page.collection() %}
  4. {% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
  5. {% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
  6. {% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
  7. {% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
  8. {% block stylesheets %}
  9. {% do assets.addCss('theme://css/bricklayer.css') %}
  10. {{ parent() }}
  11. {% endblock %}
  12. {% block javascripts %}
  13. {{ parent() }}
  14. {% do assets.add('theme://js/bricklayer.min.js') %}
  15. {% do assets.add('theme://js/scopedQuerySelectorShim.min.js') %}
  16. {% endblock %}
  17. {% block body %}
  18. <section id="body-wrapper">
  19. <section>
  20. {% embed 'partials/layout.html.twig' with {blog: page} %}
  21. {% block item %}
  22. <div class="cat-list">
  23. <ul>
  24. {% for child in collection if child.template == 'item' %}
  25. {% if child.taxonomy.category %}
  26. <li class="cat">
  27. {% include 'partials/blog/category.html.twig' with {blog: page, page: child} %}
  28. </li>
  29. {% endif %}
  30. {% endfor %}
  31. </ul>
  32. </div>
  33. <div class="works full-works">
  34. {% for child in collection if child.template == 'item' %}
  35. {% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
  36. {% endfor %}
  37. </div>
  38. {% if show_pagination and config.plugins.pagination.enabled and collection.params.pagination %}
  39. <div id="listing-footer">
  40. {% include 'partials/pagination.html.twig' with {base_url: page.url, pagination: collection.params.pagination} %}
  41. </div>
  42. {% endif %}
  43. {% endblock %}
  44. {% block sidebar %}
  45. {% include 'partials/sidebar.html.twig' %}
  46. {% endblock %}
  47. {% endembed %}
  48. </section>
  49. </section>
  50. <script>
  51. //Bricklayer
  52. var bricklayer = new Bricklayer(document.querySelector('.bricklayer'))
  53. </script>
  54. {% endblock %}