Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

4.6 KB
Raw Blame
@inject IContextAccessor contextAccessor

@{
    var supportRtl = contextAccessor.WorkContext.WorkingLanguage.Rtl;

    <partial name="Partials/ColorScheme"/>

    @*
        `defer` on all three scripts, not just this one: deferred scripts run in document
        order after parsing, so the head bundle keeps executing before app.js mounts #app.
        Deferring only the bundle would invert that and app.js would find no Vue.

        Without it this is a parser-blocking script in <head>, so the browser does not even
        build the DOM for the page body until 399 kB of JavaScript has arrived and run -
        measured at 6.4 s on Slow 4G, against 0.7 s with defer.
    *@
    <script defer asp-location="Head" src="/bundles/app.runtime.bundle.js" asp-append-version="true"></script>
    <link asp-src="/bundles/libs.css" rel="stylesheet" asp-append-version="true">

    <link rel="stylesheet" type="text/css" asp-src="/assets/custom/style.css">

    <environment include="Development">
        @if (supportRtl)
        {
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/common/common.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/header/header.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/catalog/catalog.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/product/product.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/customer/customer.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/cart/cart.rtl.css" asp-append-version="true">
        }
        else
        {
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/common/common.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/header/header.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/catalog/catalog.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/product/product.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/customer/customer.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/cart/cart.css" asp-append-version="true">
        }
    </environment>
    <environment include="Production">
        @if (supportRtl)
        {
            <link rel="stylesheet" type="text/css" asp-src="/bundles/style.rtl.min.css" asp-append-version="true">
        }
        else
        {
            <link rel="stylesheet" type="text/css" asp-src="/bundles/style.min.css" asp-append-version="true">
        }
    </environment>

    @* Modern: loaded after Default in both environments so it wins by cascade order.
       Only the latin subsets are preloaded; latin-ext loads on demand via unicode-range. *@
    <link rel="preload" href="/Plugins/Theme.Modern/Content/fonts/geist-latin-var.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="/Plugins/Theme.Modern/Content/fonts/geist-mono-latin-var.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/fonts.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/tokens.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/base.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/header.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/home.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/catalog.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/product.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/content.css" asp-append-version="true">
    <link rel="stylesheet" type="text/css" asp-src="/Plugins/Theme.Modern/Content/css/account-cart.css" asp-append-version="true">

    <partial name="Partials/JsResources"/>
    <script defer asp-location="Footer" asp-src="/theme/script/app.js" asp-order="900" asp-append-version="true"></script>
    <script defer asp-location="Footer" asp-src="/assets/custom/script.js" asp-order="901"></script>
}