hexo-theme-keep/layout/_partial/header.ejs

66 lines
2.6 KiB
Plaintext

<%
const { title: bi_title, logo_img: bi_logo_img } = theme.base_info
const { logo: s_logo, first_screen: s_first_screen } = theme.style
const { enable: s_fs_enable, header_transparent: s_fs_header_transparent } = s_first_screen
const { title: config_title } = config
%>
<header class="header-wrapper<%= is_home() && s_fs_header_transparent ? ' transparent-1' : '' %>">
<div class="header-content<%- (s_fs_enable === true && is_home() && !page.prev) ? ' has-first-screen' : '' %>">
<div class="left">
<% if (s_logo || bi_logo_img) { %>
<a class="logo-image" href="/">
<%- image_tag(s_logo || bi_logo_img) %>
</a>
<% } %>
<a class="logo-title" href="/">
<%= bi_title || config_title || 'Keep Theme' %>
</a>
</div>
<div class="right">
<div class="pc">
<ul class="menu-list">
<% for (let i in theme.menu) { %>
<li class="menu-item">
<a class="<%- isInHomePaging(page.path, theme.menu[i]) ? 'active' : is_current(theme.menu[i]) ? 'active' : '' %>"
href="<%- url_for(theme.menu[i]) %>"
>
<%= __(i.toLowerCase()).toUpperCase() %>
</a>
</li>
<% } %>
<% if (theme.local_search.enable === true) { %>
<li class="menu-item search search-popup-trigger">
<i class="fas fa-search"></i>
</li>
<% } %>
</ul>
</div>
<div class="mobile">
<% if (theme.local_search.enable === true) { %>
<div class="icon-item search search-popup-trigger"><i class="fas fa-search"></i></div>
<% } %>
<div class="icon-item menu-bar">
<div class="menu-bar-middle"></div>
</div>
</div>
</div>
</div>
<div class="header-drawer">
<ul class="drawer-menu-list">
<% for (let i in theme.menu) { %>
<li class="drawer-menu-item flex-center">
<a class="<%- isInHomePaging(page.path, theme.menu[i]) ? 'active' : is_current(theme.menu[i]) ? 'active' : '' %>"
href="<%- url_for(theme.menu[i]) %>"><%= __(i.toLowerCase()).toUpperCase() %></a>
</li>
<% } %>
</ul>
</div>
<div class="window-mask"></div>
</header>