<%
var title = page.title;

if (is_archive()){
    title = __('archive');

    if (is_month()){
        title += '：' + page.year + '/' + page.month;
    } else if (is_year()){
        title += '：' + page.year;
    }
} else if (is_category()){
    title = __('count.categories') + '：' + page.category;
} else if (is_tag()){
    title = __('count.tags') + '：' + page.tag;
}
%>
<title><% if (title){ %><%= title %> - <% } %><%= config.title %></title>
<meta charset="UTF-8">
<meta name="keywords" content="<%= config.keywords %>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">

<link rel="shortcut icon" href="<%= theme.favicon.href %>" type="<%= theme.favicon.type %>" />
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %>
<%- css([
    'lib/fancybox/fancybox.css', 
    'lib/mdui_043tiny/mdui.css'
]) %>

<%- css_auto_version('lib/iconfont/iconfont.css') %>
<% if (theme.iconlib) { %>
    <link rel="stylesheet" href="<%= theme.iconlib %>">
<% } %>
<%- css_auto_version('css/style') %>

<% if (theme.preset) { %>
    <%- css_auto_version(`preset/${theme.preset}`) %>
<% } %>

<% if (theme.customStyles) { %>
    <% theme.customStyles.forEach(function(custom){ %>
        <%- css_auto_version('custom.css') %>
    <% }) %>
<% } %>

<%- js([
    { src:'lib/mdui_043tiny/mdui.js' , async: true}, 
    { src:'lib/fancybox/fancybox.umd.js' , async: true},
    { src:'lib/lax.min.js' , async: true}
]) %>

<%- js_auto_version('js/app') %>

<% if (theme.copyText) { %>
    <script>var copyTip = "<%- theme.copyText %>"</script>
<% } %> 

<%- theme.slotHead %>

<link rel="stylesheet"  href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
