<head>
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="x-ua-compatible" content="IE=edge">
    <meta http-equiv="content-security-policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval';img-src * 'self' 'unsafe-inline' 'unsafe-eval' data:">
    <title><%= page_title() %></title>
    <% for (i in theme.preconnect) { %>
        <link rel="preconnect" href="<%= theme.preconnect[i] %>">
    <% } %>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="<%= page_keywords() %>">
    <meta name="description" content="<%= page_description() %>">
    <meta name="author" content="<%= page_author() %>">
    <%- theme.favicon.small ? `<link rel="icon" href="${theme.favicon.small}" type="image/png" sizes="32x32">` : null %>
    <%- theme.favicon.medium ? `<link rel="icon" href="${theme.favicon.medium}" type="image/png" sizes="48x48">` : null %>
    <%- theme.favicon.apple_touch_icon ? `<link rel="apple-touch-icon" href="${theme.favicon.apple_touch_icon}" sizes="180x180">` : null %>
    <%- theme.favicon.safari_pinned_tab ? `<meta rel="mask-icon" href="${theme.favicon.safari_pinned_tab}" color="#333333">` : null %>
    <% if (theme.favicon.msapplication) { %>
        <meta rel="msapplication-TileImage" content="<%- theme.favicon.msapplication %>">
        <meta rel="msapplication-TileColor" content="#000000">
    <% } %>
    <% if (page.layout == '404') { %>
        <%- css('/css/404') %>
    <% } else { %>
        <%- css(['css/style']) %>
        <% for (i in theme.font.css) { %>
            <link href="<%= theme.font.css[i] %>">
        <% } %>
        <% if (theme.vendors.iconfont_css) { %>
            <%- css(theme.vendors.iconfont_css) %>
        <% } %>
        <% if (theme.fancybox) { %>
            <%- theme.vendors.fancybox_css ? css(theme.vendors.fancybox_css) : css('lib/fancybox/fancybox.css') %>
        <% } %>
        <% if(theme.highlight.enable) { %>
            <% if(theme.vendors.highlight_css) { %>
                <% for (i in theme.highlight.style) { %>
                    <% style = theme.highlight.style[i].toLowerCase().replace(/(?<!([0-9]))\s(?!([0-9]))/g, '-').replace(/\s/g, '') %>
                    <%- css({href: theme.vendors.highlight_css + style + '.min.css', name: 'highlight-style', mode: i}) %>
                <% } %>
            <% } else { %>
            <%- css('lib/highlight/a11y-dark.css')%>
            <% } %>
        <% } %>
        <%- partial('_partial/globaldefs') %>
        <% if (theme.custom.head) { %>
            <%- theme.custom.head %>
        <% } %>
        <% if (theme.custom.css) { %>
            <%- css(theme.custom.css) %>
        <% } %>
        <%- theme.vendors.jquery_js ? js(theme.vendors.jquery_js) : js('lib/jquery/jquery.js') %>
        <% if (theme.math.enable) { %>
            <%- partial('_partial/plugins/math') %>
        <% } %>
    <% } %>
</head>
