{% if site.criticalcss %}

  <style>
    {% if page.homepage %}
      {% include critical/critical_homepage.css %}
    {% else %}
      {% include critical/critical.css %}
    {% endif %}
  </style>

  <script>
    {% include critical/loadCSS.js %}

    loadCSS("{{ root_url }}/assets/css/application.css");
    {% if page.custom_css %}
      loadCSS("{{ root_url }}/assets/css/{{ page.custom_css }}.css");
    {% endif %}
  </script>

  <noscript>
    <link rel="stylesheet" href="{{ root_url }}/assets/css/application.css">

    {% if page.custom_css %}
      <link rel="stylesheet" href="{{ root_url }}/assets/css/{{ page.custom_css }}.css">
    {% endif %}
  </noscript>

{% else %}

  {% if page.homepage %}
    <link rel="stylesheet" href="{{ root_url }}/assets/css/critical_homepage.css">
  {% else %}
    <link rel="stylesheet" href="{{ root_url }}/assets/css/critical.css">
  {% endif %}

  <link rel="stylesheet" href="{{ root_url }}/assets/css/application.css">

  {% if page.custom_css %}
    <link rel="stylesheet" href="{{ root_url }}/assets/css/{{ page.custom_css }}.css">
  {% endif %}

{% endif %}
