<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="<%= page?.keywords || config?.keywords || 'Hexo Theme Keep' %>">
  <meta name="description" content="<%= page?.description || config?.description || 'Hexo Theme Keep' %>">
  <meta name="author" content="<%= theme?.base_info?.author || config?.author || 'Keep Team' %>">
  <%
  let 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 = __('category') + ': ' + page.category;
  } else if (is_tag()) {
    title = __('tag') + ': ' + page.tag;
  } else {
    title = __(page.title);
  }
  %>
  <title>
    <% if (title) { %>
      <%= title %> |
    <% } %>
    <%= theme?.base_info?.title || config?.title || 'Keep Theme' %>
  </title>
  <%- css('css/style') %>
  <% if (theme?.base_info?.favicon) { %>
    <%- favicon_tag(theme?.base_info?.favicon) %>
  <% } %>
  <%- __css('font/css/fontawesome.min.css') %>
  <%- __css('font/css/regular.min.css') %>
  <%- __css('font/css/solid.min.css') %>
  <%- __css('font/css/brands.min.css') %>
  <% if (theme?.inject?.enable === true) { %>
    <% theme?.inject?.css?.forEach((css_path) => { %>
      <% if (css_path && isCssFile(css_path)) { %>
        <%- css(css_path) %>
      <% } %>
    <% }) %>
  <% } %>
  <script>
    (function () {
      let theme = localStorage.getItem('KEEP-THEME-STATUS');
      let classname = "";
      if (!theme || (JSON.parse(theme).isAutoTheme)){
        classname = (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) ? "dark-mode" : "light-mode";
      }
      else{
        classname = JSON.parse(theme).isDark ? "dark-mode" : "light-mode";
      }
      document.documentElement.classList.add(classname);
    })();
  </script>
  <%- exportThemeConfig() %>
</head>

