hexo-theme-stellar/layout/_partial/main/navbar/list_wiki.ejs

29 lines
941 B
Plaintext
Raw Normal View History

2021-02-20 13:09:41 +08:00
<div class='nav-wrap'>
2021-02-23 21:09:49 +08:00
<nav class='sub wiki cap'>
2021-02-20 13:09:41 +08:00
<% if (page.layout == 'index' && page.title && page.wiki) { %>
2021-02-22 23:39:41 +08:00
<a href='<%- url_for(config.wiki_dir || "/wiki/") %>'><%- __('btn.all_wiki') %></a>
2021-02-20 13:09:41 +08:00
<% } else { %>
2021-02-22 23:39:41 +08:00
<a class='active' href='<%- url_for(config.wiki_dir || "/wiki/") %>'><%- __('btn.all_wiki') %></a>
2021-02-20 13:09:41 +08:00
<% } %>
<%
var groups = [];
var paths = [];
site.pages.filter(function (p) {
return p.layout == 'index' && p.title && p.wiki;
}).sort('order').each(function(p) {
if (groups.includes(p.wiki) == false) {
groups.push(p.title);
paths.push(p.path);
}
});
%>
<% groups.forEach((group, i) => { %>
<% if (page.title == group) { %>
<a class='active' href='<%- url_for(paths[i]) %>'><%- group %></a>
<% } else { %>
<a class='' href='<%- url_for(paths[i]) %>'><%- group %></a>
<% } %>
<% }); %>
2021-02-22 23:39:41 +08:00
</nav>
2021-02-20 13:09:41 +08:00
</div>