You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.3 KiB

3 years ago
<%
var menuMap = new Map();
menuMap.set("Index", "首页");
menuMap.set("Tags", "标签");
menuMap.set("Categories", "分类");
menuMap.set("Archives", "归档");
menuMap.set("About", "关于");
menuMap.set("Contact", "留言板");
menuMap.set("Friends", "友链");
menuMap.set("List", "清单");
menuMap.set("Navi", "百宝箱");
menuMap.set("Hacking", "谷歌搜索");
menuMap.set("More", "更多");
var configRoot = config.root
configRoot = (configRoot === null || configRoot === undefined || configRoot === '/') ? '' : configRoot;
%>
<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
<% Object.keys(theme.menu).forEach(function(key) { %>
<li class="hide-on-med-and-down nav-item">
<% if(!theme.menu[key].children) { %>
<a href="<%- url_for(theme.menu[key].url) %>" class="waves-effect waves-light">
<% if (theme.menu[key].icon && theme.menu[key].icon.length > 0) { %>
<i class="<%- theme.menu[key].icon %>" style="zoom: 0.6;"></i>
<% } %>
<span><%- (config.language === 'zh-CN' && menuMap.has(key)) ? menuMap.get(key) : key %></span>
</a>
<% } else { %>
<a href="<%- theme.menu[key].url %>" class="waves-effect waves-light">
<% if (theme.menu[key].icon && theme.menu[key].icon.length > 0) { %>
<i class="<%- theme.menu[key].icon %>" style="zoom: 0.6;"></i>
<% } %>
<span><%- (config.language === 'zh-CN' && menuMap.has(key)) ? menuMap.get(key) : key %></span>
<i class="fas fa-chevron-down" aria-hidden="true" style="zoom: 0.6;"></i>
</a>
<ul class="sub-nav menus_item_child ">
<% for(let childrenLink of theme.menu[key].children){ %>
<li>
<a href="<%- url_for(childrenLink.url)%>">
<% if (childrenLink.icon && childrenLink.icon.length > 0) { %>
<i class="<%- childrenLink.icon %>" style="margin-top: -20px; zoom: 0.6;"></i>
<% } %>
<span><%- childrenLink.name %></span>
</a>
</li>
<% } %>
</ul>
<% } %>
</li>
<% }); %>
<li>
<a href="#searchModal" class="modal-trigger waves-effect waves-light">
<i id="searchIcon" class="fas fa-search" title="<%= __('search') %>" style="zoom: 0.85;"></i>
</a>
</li>
</ul>
<%- partial('_partial/mobile-nav') %>