<!DOCTYPE html>
<html<%= config.language ? " lang=" + config.language.substring(0, 2) : ""%>>
<head>
    <meta charset="utf-8">
    <%
        function capitalize (str) { return str.charAt(0).toUpperCase() + str.substring(1).toLowerCase() }
        var title = page.title;
        if (is_archive()) {
            title = capitalize(__('index.archive'));
            if (is_month()) {
                title += ': ' + page.year + '/' + page.month;
            } else if (is_year()) {
                title += ': ' + page.year;
            }
        } else if (is_category()) {
            title = capitalize(__('index.category')) + ': ' + page.category;
        } else if (is_tag()) {
            title = capitalize(__('index.tag')) + ': ' + page.tag;
        }
    %>
    <title><% if (title) { %><%= title %> | <% } %><%= config.title %></title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <%- open_graph({
        image:          thumbnail(page),
        fb_app_id:      theme.miscellaneous.open_graph.fb_app_id,
        fb_admins:      theme.miscellaneous.open_graph.fb_admins,
        twitter_id:     theme.miscellaneous.open_graph.twitter_id,
        google_plus:    theme.miscellaneous.open_graph.google_plus,
    }) %>
    <%- meta(page) %>

    <% if (theme.customize && theme.customize.social_links && theme.customize.social_links.rss) { %>
        <link rel="alternate" href="<%- theme.customize.social_links.rss %>" title="<%= config.title %>" type="application/atom+xml" />
    <% } %>

    <% if (theme.customize.favicon) { %>
        <link rel="icon" href="<%- url_for(theme.customize.favicon) %>" />
    <% } %>

    <%- css('libs/font-awesome5/css/fontawesome.min') %>
    <%- css('libs/font-awesome5/css/fa-brands.min') %>
    <%- css('libs/font-awesome5/css/fa-solid.min') %>
    <%- css('libs/open-sans/styles') %>
    <%- css('libs/source-code-pro/styles') %>

    <%- css('css/style') %>

    <%- js('libs/jquery/2.1.3/jquery.min') %>
    <%- partial('plugin/scripts', { isHead: true }) %>
</head>
