{#
/**
 * @file
 * Preload assets.
 *
 * Available variables:
 * - vartheme_bs5_path: Returns the path to the Vartheme BS5 theme.
 * - html_dir: contains the language direction. It will either be 'ltr' or 'rtl'.
 */
#}

{#
* NOTE: Change the logic in this file to match the need of your website.

* Example of logic: 
    - Multilingual websites may use a language selection for preloaded assets.
    - Sections of the website may have a custom prelead assets for CSS/JS.
*  --------------------------------------------------------------------------
*  Have a look at "Preload critical assets to improve loading speed"
*  https://web.dev/preload-critical-assets/
*  for more ideas on what/when/where to use preload.
#}

{# Preload assets for all languages and all sections in the website. #}

{# Preload Bootstrap Icons #}
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/bootstrap-icons/font/fonts/bootstrap-icons.woff" as="font" type="font/woff" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/bootstrap-icons/font/fonts/bootstrap-icons.woff2" as="font" type="font/woff2" crossorigin="anonymous">

{# Preload Font Awesome free Regular webfonts #}
{# Uncomment to use the Font Awesome free Regular webfonts.
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-regular-400.eot" as="font" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-regular-400.svg" as="font" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-regular-400.ttf" as="font" type="font/ttf" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-regular-400.woff" as="font" type="font/woff" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-regular-400.woff2" as="font" type="font/woff2" crossorigin="anonymous">
#}

{# Preload Font Awesome free Solid webfonts #}
{# Uncomment to use the Font Awesome free Solid webfonts library.
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-solid-900.eot" as="font" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-solid-900.svg" as="font" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-solid-900.ttf" as="font" type="font/ttf" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-solid-900.woff" as="font" type="font/woff" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin="anonymous">
#}

{# Preload Font Awesome free Brands webfonts #}
{# Uncomment to use the Font Awesome free Brands webfonts library.
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-brands-400.eot" as="font" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-brands-400.svg" as="font" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-brands-400.ttf" as="font" type="font/ttf" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-brands-400.woff" as="font" type="font/woff" crossorigin="anonymous">
<link rel="preload" href="{{ vartheme_bs5_path }}/fonts/fontawesome-free/webfonts/fa-brands-400.woff2" as="font" type="font/woff2" crossorigin="anonymous">
#}

{# Preload assets only for LTR languages. #}
{% if html_dir == 'ltr' %}
  {# Preload Font Inter #}
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/inter/webfonts/inter.eot" as="font" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/inter/webfonts/inter.svg" as="font" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/inter/webfonts/inter.ttf" as="font" type="font/ttf" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/inter/webfonts/inter.woff" as="font" type="font/woff" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/inter/webfonts/inter.woff2" as="font" type="font/woff2" crossorigin="anonymous">
{%- endif -%}


{# Preload assets only for RTL languages. #}
{% if html_dir == 'rtl' %}
  {# Preload Font Droid Arabic Kufi Regular #}
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Bold.eot" as="font" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Bold.ttf" as="font" type="font/ttf" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Bold.woff" as="font" type="font/woff" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">

  {# Preload Font Droid Arabic Kufi Bold #}
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Regular.eot" as="font" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Regular.woff" as="font" type="font/woff" crossorigin="anonymous">
  <link rel="preload" href="{{ vartheme_bs5_path }}/fonts/droid/arabic/kufi/webfonts/v6/DroidKufi-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
{% endif %}

{# Example: Preload assets only for LTR languages.
* By adding more restraction or selection for what/when/where to use for preload.
* Selected preload could work for a selected language. 
*  --------------------------------------------------------------------------
{% if html_dir == 'ltr' %}
  <link rel="preload" href="/{{ vartheme_bs5_path }}/fonts/lora/lora-v14-latin-regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
{%- endif -%}
*  --------------------------------------------------------------------------
* Needs to add the font files in the right location for local fonts.
#}
