elf-notes/templates/macros/font_preloads.html

13 lines
364 B
HTML
Raw Normal View History

{% macro preloads() %}
{% if config.extra.preloads %}
{% for preload in config.extra.preloads %}
<link
rel="preload"
as="font"
href="{{ get_url(path="{{ preload }}") | safe }}"
type="{% if preload is ending_with(".woff2") %}font/woff2{% else %}font/woff{% endif %}"
crossorigin />
{% endfor %}
{% endif %}
{% endmacro %}