footnote-list.html.twig 962 B

1234567891011121314151617181920212223
  1. {# footnotes/footnote-list.html.twig #}
  2. <ul class="footnotes">
  3. {% for fn in footnotes %}
  4. {% if fn.ref_id is iterable %}
  5. {#
  6. // Output footnote that has more than one reference to it in the body.
  7. // The only difference is to insert backlinks to all references.
  8. // Helper: we need to enumerate a, b, c...
  9. #}
  10. {% set abc = "abcdefghijklmnopqrstuvwxyz"|split('') %}
  11. {% set i = 0 %}
  12. <li class="footnote" id="{{ fn.fn_id }}"><a href="#{{ fn.ref_id.0 }}" class="footnote-label">{{ fn.value }}</a>
  13. {% for ref in fn.ref_id %}
  14. <a class="footnote-multi" href="#{{ ref }}">{{ attribute(abc, i) }}</a>
  15. {% set i = i + 1 %}
  16. {% endfor %}
  17. {{ fn.text|raw }}</li>
  18. {% else %}
  19. {# Output normal footnote. #}
  20. <li class="footnote" id="{{ fn.fn_id }}"><a class="footnote-label" href="#{{ fn.ref_id }}">{{ fn.value }}</a>{{ fn.text|raw }}</li>
  21. {% endif %}
  22. {% endfor %}
  23. </ul>