summaryrefslogtreecommitdiff
path: root/themes/theme/layout/partials/header.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'themes/theme/layout/partials/header.ejs')
-rw-r--r--themes/theme/layout/partials/header.ejs42
1 files changed, 42 insertions, 0 deletions
diff --git a/themes/theme/layout/partials/header.ejs b/themes/theme/layout/partials/header.ejs
new file mode 100644
index 00000000..97752d9e
--- /dev/null
+++ b/themes/theme/layout/partials/header.ejs
@@ -0,0 +1,42 @@
+<div class="header">
+ <div class="flex-container">
+ <div class="header-inner">
+ <div class="site-brand-container">
+ <a href="<%= url_for()%>">
+ <% if (theme.logo_image.enable) {%>
+ <img class="logo-img" src="<%= url_for(theme.logo_image.image_path)%>" alt="logo_image">
+ <%} else {%>
+ <%= theme.site_brand_name %>
+ <% } %>
+ </a>
+ </div>
+ <div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
+ 菜单
+ </div>
+ <nav class="site-nav">
+ <ul class="menu-list">
+ <% Object.keys(theme.menu).forEach(key=> { %>
+ <% if (url_for(theme.menu[key]) + "index.html"==url_for(page.path)) {%>
+ <li class="menu-item menu-item-active">
+ <a href="<%=url_for(theme.menu[key])%>">
+ <%=key%>
+ </a>
+ </li>
+ <%} else {%>
+ <li class="menu-item">
+ <a href="<%=url_for(theme.menu[key])%>">
+ <%=key%>
+ </a>
+ </li>
+ <% }%>
+ <% }); %>
+ <% if (theme.local_search.enable) {%>
+ <li class="menu-item">
+ <a href="/search">搜索</a>
+ </li>
+ <% } %>
+ </ul>
+ </nav>
+ </div>
+ </div>
+</div>