From 7130d47a2cf4cf256ae927dafc411befab50334c Mon Sep 17 00:00:00 2001
From: Doge
Date: Fri, 28 May 2021 10:24:29 +0800
Subject: Add sub-navbar support
---
_config.yml | 1 -
layout/_partial/header.ejs | 58 +++++++++++++++++++++++++---------------------
2 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/_config.yml b/_config.yml
index 2e1f71c..ac53ea8 100644
--- a/_config.yml
+++ b/_config.yml
@@ -83,7 +83,6 @@ subnav:
- ['#peace', 'fa fa-globe', 'Peace']
- ['#human', 'fa fa-male', 'Human']
-
# Menubar and its texts
# ------------------------------------------------------------
# 菜单栏的地址和文字
diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs
index 6a61396..b32edbb 100644
--- a/layout/_partial/header.ejs
+++ b/layout/_partial/header.ejs
@@ -43,33 +43,39 @@
<%- config.description %>
- <% if (theme.subnav) { %>
-
- <% } else { %>
-
- <% } %>
- <% for (let index in theme.navbar) { %>
- <%
- const mapping = theme.navbar[index];
- const link = mapping[0];
- const favicon = mapping[1];
- const description = mapping[2];
- let outter = link.startsWith("https://") ? true : false;
- %>
- <% if (outter) { %>
-
- <% } else { %>
-
- <% } %>
-
-
-
-
- <%= description %>
-
-
+ <% if (theme.navbar) { %>
+ <% if (theme.subnav) { %>
+
+ <% } else { %>
+
<% } %>
-
+
+
+ <% for (let index in theme.navbar) { %>
+ <%
+ const mapping = theme.navbar[index];
+ const link = mapping[0];
+ const favicon = mapping[1];
+ const description = mapping[2];
+ let outter = link.startsWith("https://") ? true : false;
+ %>
+ <% if (outter) { %>
+
+ <% } else { %>
+
+ <% } %>
+
+
+
+
+ <%= description %>
+
+
+ <% } %>
+
+
+
+ <% } %>
<% if (theme.subnav) { %>