<!DOCTYPE html>
<html lang="<%= config.language %>">

<!-- Head tag -->
<%- partial('_partial/head') %>

<body>
    <%- partial('_partial/header',{cache: true}) %>
    <!-- Main Content -->
    <div class="main-container">
        <%- body %>
    </div>
    <%- partial('_partial/go-top') %>
    <%- partial('_widget/click-image.ejs') %>
    <!-- Footer -->
    <%- partial('_partial/footer') %>

    <script>
        // 非本站网址，新开tab页签
        (function () {
            var stopBubble = function (e) {
                e && e.stopPropagation && e.stopPropagation();
            }
            var links = document.querySelectorAll('a');
            [].slice.call(links).forEach(function (item) {
                if (item.href && item.href.indexOf(window.location.host) === -1) {
                    item.target = '_blank'
                }
                // 阻止冒泡，不触发彩蛋。
                item.addEventListener('click', stopBubble, false);
            });
            var article = document.querySelector('article');
            article && article.addEventListener('click', stopBubble, false)
        })();
    </script>
    <%- partial('_widget/click-egg.ejs') %>
</body>

</html>