Source

markwiki / templates / macros / crumbs

Full commit
{% macro crumbs(breadcrumbs) %}
  {% if breadcrumbs %}
    <ol id="breadcrumbs">
      {% for name, href in breadcrumbs %}
        <li class="crumb-{{ loop.index0 }} {% if loop.last %}last{% else %}not-last{% endif %}">
          {% if not href %}
            {{ name|e }}
          {% else %}
            <a href="{{ make_relative(href)|e }}index.html">{{ name|e }}</a>
          {% endif %}
        </li>
      {% endfor %}
    </ol> <!-- ol#breadcrumbs -->
  {% endif %}
{% endmacro %}