diff options
author | Doge <[email protected]> | 2021-05-28 10:24:29 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-28 10:24:29 +0800 |
commit | 7130d47a2cf4cf256ae927dafc411befab50334c (patch) | |
tree | ea52937239fc2c70a079a3ee8bac4ee83361286a | |
parent | c05d392b14349f2d565d9fa1395ad5b4dd4bd68d (diff) | |
download | chromate-7130d47a2cf4cf256ae927dafc411befab50334c.tar.gz chromate-7130d47a2cf4cf256ae927dafc411befab50334c.tar.bz2 chromate-7130d47a2cf4cf256ae927dafc411befab50334c.zip |
Add sub-navbar support
-rw-r--r-- | _config.yml | 1 | ||||
-rw-r--r-- | 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 @@ </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"> |