nav-next/themes/webstack/layout/index.ejs
2024-11-16 12:03:09 +08:00

84 lines
4.5 KiB
Plaintext

<% const isChildPage = page.type === 'child' %>
<% const setting = isChildPage ? Object.assign(theme, page) : theme %>
<% console.log(page.path) %>
<body class="page-body">
<div class="page-container">
<%- partial('common/header', {setting:setting}) %>
<div class="main-content">
<nav class="navbar user-info-navbar" role="navigation">
<ul class="user-info-menu left-links list-inline list-unstyled">
<li class="hidden-sm hidden-xs hover-line">
<a href="#" data-toggle="sidebar">
<i class="fas fa-bars"></i>
</a>
</li>
<!-- <li class="dropdown hover-line language-switcher">
<a href="/index.html" class="dropdown-toggle" data-toggle="dropdown">
<img src="/images/flags/<%= setting.flag.icon %>.png" alt="<%= setting.flag.icon %>" /> <%= setting.flag.name %>
</a>
<ul class="dropdown-menu languages">
<li class="active">
<a href="/index.html">
<img src="/images/flags/<%= setting.flag.icon %>.png" alt="<%= setting.flag.icon %>" alt="<%= setting.flag.icon %>" /> <%= setting.flag.name %>
</a>
</li>
</ul>
</li> -->
<li class="switch-mode hover-line" onclick="switchNightMode()">
<a href="#">
<svg t="1593061068148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1681" width="16" height="16">
<path d="M582.4 326.4c-140.8 0-256 115.2-256 256s115.2 256 256 256 256-115.2 256-256-115.2-256-256-256z m0 448c-70.4 0-131.2-36.8-164.8-92.8 12.8 3.2 27.2 4.8 40 4.8 121.6 0 219.2-99.2 219.2-219.2 0-17.6-1.6-35.2-6.4-52.8 60.8 32 102.4 96 102.4 169.6 1.6 104-84.8 190.4-190.4 190.4zM582.4 262.4c17.6 0 32-14.4 32-32v-128c0-17.6-14.4-32-32-32s-32 14.4-32 32v128c0 17.6 14.4 32 32 32zM262.4 582.4c0-17.6-14.4-32-32-32h-128c-17.6 0-32 14.4-32 32s14.4 32 32 32h128c17.6 0 32-14.4 32-32zM310.4 356.8c6.4 6.4 14.4 9.6 22.4 9.6 8 0 16-3.2 22.4-9.6 12.8-12.8 12.8-32 0-44.8l-91.2-91.2c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l91.2 91.2zM944 220.8c-12.8-12.8-32-12.8-44.8 0l-91.2 91.2c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.4 9.6 22.4 9.6 8 0 16-3.2 22.4-9.6l91.2-91.2c12.8-12.8 12.8-33.6 0-44.8zM310.4 808l-91.2 91.2c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.4 9.6 22.4 9.6 8 0 16-3.2 22.4-9.6l91.2-91.2c12.8-12.8 12.8-32 0-44.8-11.2-11.2-32-11.2-44.8 0z" p-id="1682" fill="#707070"></path>
</svg>
</a>
</li>
</ul>
<% if (setting.githubCorner) { %>
<%- setting.githubCorner %>
<% } %>
</nav>
<% if(setting.search){ %>
<section class="sousuo">
<div class="search">
<div class="search-box">
<span class="search-icon" style="background: url(https://sh.jsdmirror.com/npm/hassan-assets/navi/search_icon.png) 0px 0px; opacity: 1;"></span>
<input type="text" id="txt" class="search-input" autocomplete="off" placeholder="请输入关键字,按回车 / Enter 搜索">
<button class="search-btn" id="search-btn"><i class="fa fa-search"></i></button>
</div>
<!-- 搜索热词 -->
<div class="box search-hot-text" id="box" style="display: none;">
<ul></ul>
</div>
<!-- 搜索引擎 -->
<div class="search-engine" style="display: none;">
<div class="search-engine-head">
<strong class="search-engine-tit">选择您的默认搜索引擎:</strong>
<div class="search-engine-tool">搜索热词: <span id="hot-btn"></span></div>
</div>
<ul class="search-engine-list search-engine-list_zmki_ul">
</ul>
</div>
</section>
<script>search()</script>
<% } %>
<% if(is_home() || isChildPage){ %>
<% const menuSetting = isChildPage ? page : theme; %>
<% menuSetting.menu.forEach(function(e) { %>
<% if (e.submenu) { %>
<% e.submenu.forEach(function(e) { %>
<% const childPath = page.path.replace('index.html', '') + e.config; %>
<% const key = isChildPage?childPath:e.config; %>
<% var menus = site.data && site.data[key] ? site.data[key] : menuSetting[e.config]; %>
<%- partial('common/group.ejs', {e: e, menus: menus || []}); %>
<% }) %>
<% } else { %>
<% const childPath = page.path.replace('index.html', '') + e.config; %>
<% const key = isChildPage?childPath:e.config; %>
<% var menus = site.data && site.data[key] ? site.data[key] : menuSetting[e.config]; %>
<% console.log(page.path,childPath,key); %>
<%- partial('common/group.ejs', {e: e, menus: menus || []}); %>
<% } %>
<% }) %>
<% } %>
<%- js(setting.js.footer) %>