<!DOCTYPE html>
<html lang="<%= config.language || 'en' %>">
    <%- partial('_partial/configcss/font') %>
    <%- partial('_partial/head') %>
    <%- partial('_partial/configcss/width') %>
    <%- partial('_partial/configcss/color') %>
    <%- partial('_partial/configcss/imageShow') %>
    
    <body>
        <script src="/js/darkmode-js.min.js"></script>
        <% if(theme.tool.darkMode) { %>
        <script>
            const options = {
                bottom: '40px', // default: '32px'
                right: 'unset', // default: '32px'
                left: '42px', // default: 'unset'
                time: '0.3s', // default: '0.3s'
                mixColor: '#fff', // default: '#fff'
                backgroundColor: '<% if(theme.color.enable) { %> <%=theme.color.background %>  <% } else { %> #e4e4e4 <%}%>',  // default: '#fff'
                buttonColorDark: '#100f2c',  // default: '#100f2c'
                buttonColorLight: '#fff', // default: '#fff'
                saveInCookies: true, // default: true,
                label: '🌓', // default: ''
                autoMatchOsTheme: true // default: true
            }
            const darkmode = new Darkmode(options);
            darkmode.showWidget();
        </script>
        <% } %>
        <% if(theme.tool.leftToc) { %>
            <div class="left-toc-container">
                <nav id="toc" class="bs-docs-sidebar"></nav>
            </div>
        <% } %>
        <div class="paper">
            
            <% var tags,tagsInside, categories, categoriesInside; %>
            
            <% if(path == "index.html") { %>
                <div class="shadow-drop-2-bottom index-main">
                    <%- partial('_partial/header') %>
                    <%- partial('index') %> 
                    <%- partial('_partial/footer') %>
                </div>
            <% } else if(path == "list/index.html") { %>
                <div class="shadow-drop-2-top paper-main">
                     <%- partial('_partial/post-header') %> 
                     <%- partial('list') %> 
                     <%- partial('_partial/footer') %>
                </div>
            <% } else if(path == "404.html") { %>
                <div class="shadow-drop-2-top paper-main">
                    <%- partial('_partial/404-template') %> 
                    <%- partial('_partial/footer') %>
                </div>
            <% } else if(path == "recent-updates/index.html") { %>
                <div class="shadow-drop-2-top paper-main">
                    <%- partial('_partial/post-header') %> 
                    <%- partial('_partial/recent-updates') %> 
                    <%- partial('_partial/footer') %>
               </div>
            <% } else { %>
                <div class="shadow-drop-2-bottom paper-main">
                    <%- partial('_partial/post-header') %> 
        
                    <% if(tags = (path == "tags/index.html")) { %>
                            <%- partial('tags') %>
                    <% } %>
                    <% if(categories = (path == "categories/index.html")) { %>
                            <%- partial('categories') %>
                    <% } %>

                    <% if(tagsInside = (path.length > "tags/index.html".length && path.substring(0, 5) == "tags/")) { %>
                            <%- partial('_partial/tags-list') %> 
                    <% } %>
                    <% if(categoriesInside = (path.length > "categories/index.html".length && path.substring(0, 11) == "categories/")) { %>
                        <%- partial('_partial/categories-list') %> 
                    <% } %>
                    
                    <!--说明是文章post页面-->
                    <% if (!tags && !categories && !tagsInside && !categoriesInside) { %>
                        <%- partial('post') %>
                                      
                    <% } %>
                    
                    <%- partial('_partial/footer') %>
                </div>
            <% } %>
            <% if(theme.tool.returnToTop) { %>
                <!-- 回到顶部的按钮-->  
                <div class="progress-wrap shadow-drop-2-bottom">
                    <svg class="progress-circle svg-content" width="100%" height="100%" viewBox="-1 -1 102 102">
                        <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98"/>
                    </svg>
                </div>
            <% } %>
            <% if(theme.tool.returnToLast) { %>
                <!-- 返回的按钮-->  
                <div class="return-to-last-progress-wrap shadow-drop-2-bottom">
                    <svg class="progress-circle svg-content" width="100%" height="100%" viewBox="-1 -1 102 102">
                        <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98"/>
                    </svg>
                </div>
            <% } %>
    </body>
</html>