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

29 lines
955 B
Plaintext

<div class='nav-wrap mobile-hidden'>
<nav class='sub wiki cap'>
<% if (page.layout == 'index' && page.title && page.wiki) { %>
<a href='<%- url_for(config.wiki_dir || "/wiki/") %>'><%- __('btn.all_wiki') %></a>
<% } else { %>
<a class='active' href='<%- url_for(config.wiki_dir || "/wiki/") %>'><%- __('btn.all_wiki') %></a>
<% } %>
<%
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>
<% } %>
<% }); %>
</nav>
</div>