{% load friendly_loader wagtailcore_tags wagtailsettings_tags cjkcms_tags %}
{% friendly_load webpack_loader %}
    {% if settings.cjkcms.LayoutSettings.frontend_theme == 'python-webpack' %} {# use python-webpack from Michael Yin #}
        {% if_has_tag stylesheet_pack %}
            {% stylesheet_pack 'app' %}
        {% endif_has_tag %}
    {% elif settings.cjkcms.LayoutSettings.frontend_theme == 'mdb.light' %}
        <link
            href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.1.0/mdb.min.css"
            rel="stylesheet"
            crossorigin="anonymous">
    {% elif settings.cjkcms.LayoutSettings.frontend_theme == 'mdb.dark' %}
        <link
            href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.1.0/mdb.dark.min.css"
            rel="stylesheet"
            crossorigin="anonymous">
    {% else %}
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" 
            rel="stylesheet" 
            integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" 
            crossorigin="anonymous">
    {% endif %}
    {% if settings.cjkcms.LayoutSettings.awesome_cdn %}
        <!-- Font Awesome -->
        <link
            href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
            rel="stylesheet"
            crossorigin="anonymous">
    {% endif %}
    {% if settings.cjkcms.LayoutSettings.custom_font %}
        <!-- Google Fonts -->
        <link
        href="{{ settings.cjkcms.LayoutSettings.font_url }}"
        rel="stylesheet"
        crossorigin="anonymous">
        <style>
            body {
                font-family: {{ settings.cjkcms.LayoutSettings.font_family }} !important;
            }
        </style>
    {% endif %}
