<%
var subtitle = page.subtitle || page.title
var banner_img_height = parseInt(page.banner_img_height || theme.index.banner_img_height, 10) || 100
var colorSchema = theme.dark_mode && theme.dark_mode.enable && theme.dark_mode.default ? theme.dark_mode.default : ''
%>

<!DOCTYPE html>
<html lang="<%= config.language %>" <%= colorSchema ? `data-default-color-scheme=${colorSchema}` : '' %>>

<%- partial('_partials/head.ejs') %>

<body>
  <%- inject_point('bodyBegin') %>

  <header>
    <%- inject_point('header') %>
  </header>

  <main>
    <% if(is_post() || page.layout === '404') { %>
      <%- body %>
    <% } else { %>
      <div class="container nopadding-x-md">
        <div id="board"
          <%- banner_img_height >= 100 && theme.banner && theme.banner.parallax ? 'style="margin-top: 0"' : '' %>>
          <% if(page.layout === 'about') { %>
            <div class="about-avatar">
              <img src="<%= url_for(theme.about.avatar) %>" class="img-fluid" alt="avatar">
            </div>
          <% } %>
          <div class="container">
            <div class="row">
              <div class="col-12 col-md-10 m-auto">
                <%- body %>
              </div>
            </div>
          </div>
        </div>
      </div>
    <% } %>

    <% if (theme.scroll_top_arrow.enable) { %>
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    <% } %>

    <% if (theme.search.enable) { %>
      <%- partial('_partials/search.ejs') %>
    <% } %>

    <% if (theme.custom_html) { %>
      <div class="col-lg-7 mx-auto nopadding-x-md">
        <div class="container custom mx-auto">
          <%- theme.custom_html %>
        </div>
      </div>
    <% } %>
  </main>

  <footer>
    <%- inject_point('footer') %>
  </footer>

  <!-- Scripts -->
  <%- partial('_partials/scripts.ejs') %>

  <%- inject_point('bodyEnd') %>

  <noscript>
    <div class="noscript-warning"><%- __('noscript_warning') %></div>
  </noscript>
  <script src="https://cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.js"></script>
</body>
</html>
