summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorDoge <[email protected]>2021-05-28 10:24:29 +0800
committerDoge <[email protected]>2021-05-28 10:24:29 +0800
commit7130d47a2cf4cf256ae927dafc411befab50334c (patch)
treeea52937239fc2c70a079a3ee8bac4ee83361286a /layout
parentc05d392b14349f2d565d9fa1395ad5b4dd4bd68d (diff)
downloadchromate-7130d47a2cf4cf256ae927dafc411befab50334c.tar.gz
chromate-7130d47a2cf4cf256ae927dafc411befab50334c.tar.bz2
chromate-7130d47a2cf4cf256ae927dafc411befab50334c.zip
Add sub-navbar support
Diffstat (limited to 'layout')
-rw-r--r--layout/_partial/header.ejs58
1 files changed, 32 insertions, 26 deletions
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 @@
</p>
<p class="subtitle is-size-6">
<%- config.description %>
- <% if (theme.subnav) { %>
- <div class="container subnav-top">
- <% } else { %>
- <div class="container">
- <% } %>
- <% 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) { %>
- <a href="<%= link %>" target="_blank" rel="noopener noreferrer">
- <% } else { %>
- <a href="<%= link %>">
- <% } %>
- <span class="icon-text">
- <span class="icon">
- <i class="<%= favicon %>"></i>
- </span>
- <span><%= description %></span>
- </span>
- </a>
+ <% if (theme.navbar) { %>
+ <% if (theme.subnav) { %>
+ <div class="container subnav-top">
+ <% } else { %>
+ <div class="container">
<% } %>
- </div>
+ <div class="columns subnav-bottom">
+ <div class="column is-10-mobile is-offset-1-mobile is-one-third is-offset-one-third">
+ <% 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) { %>
+ <a href="<%= link %>" target="_blank" rel="noopener noreferrer">
+ <% } else { %>
+ <a href="<%= link %>">
+ <% } %>
+ <span class="icon-text">
+ <span class="icon">
+ <i class="<%= favicon %>"></i>
+ </span>
+ <span><%= description %></span>
+ </span>
+ </a>
+ <% } %>
+ </div>
+ </div>
+ </div>
+ <% } %>
<% if (theme.subnav) { %>
<div class="container has-text-weight-medium is-size-7">
<div class="columns subnav-bottom">