breadcrumbs.html 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. {% comment %}
  2. Fil d'Ariane (Breadcrumbs) avec Schema.org
  3. Usage: {% include 'blog/breadcrumbs.html' with breadcrumbs=breadcrumbs_list %}
  4. {% endcomment %}
  5. {% if breadcrumbs %}
  6. <nav aria-label="Fil d'Ariane">
  7. <ol class="breadcrumb" style="background-color: rgba(250,250,250,0.88); margin-bottom: 1.5rem;">
  8. {% for item in breadcrumbs %}
  9. <li class="breadcrumb-item{% if forloop.last %} active{% endif %}"{% if forloop.last %} aria-current="page"{% endif %}>
  10. {% if not forloop.last %}
  11. <a href="{{ item.url }}">{{ item.name }}</a>
  12. {% else %}
  13. {{ item.name }}
  14. {% endif %}
  15. </li>
  16. {% endfor %}
  17. </ol>
  18. </nav>
  19. <!-- Schema.org BreadcrumbList -->
  20. <script type="application/ld+json">
  21. {
  22. "@context": "https://schema.org",
  23. "@type": "BreadcrumbList",
  24. "itemListElement": [
  25. {% for item in breadcrumbs %}
  26. {
  27. "@type": "ListItem",
  28. "position": {{ forloop.counter }},
  29. "name": "{{ item.name }}",
  30. "item": "{{ item.url }}"
  31. }{% if not forloop.last %},{% endif %}
  32. {% endfor %}
  33. ]
  34. }
  35. </script>
  36. {% endif %}