29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
<% if (page.layout == 'wiki') { %>
|
|
<% site.pages.filter(function (p) { %>
|
|
<% return p.layout == 'index' && p.title && p.wiki && p.wiki.includes(page.wiki) %>
|
|
<% }).limit(1).each(function(current_group) { %>
|
|
<% if (current_group.wiki.length > 1) { %>
|
|
<div class='widget-wrap' id='related'>
|
|
<div class='widget-header dis-select'>
|
|
<span class='name'>更多<%- current_group.title %></span>
|
|
</div>
|
|
<div class='widget-body'>
|
|
<% current_group.wiki.forEach((wiki, i) => { %>
|
|
<% site.pages.filter(function (p) { %>
|
|
<% return p.wiki == wiki && p.wiki != page.wiki && p.description %>
|
|
<% }).each(function(post) { %>
|
|
<% if (post.wiki || post.title) { %>
|
|
<div class='post-title'>
|
|
<a href="<%= url_for(post.link || post.path) %>">
|
|
<%- post.wiki || post.title %>
|
|
</a>
|
|
</div>
|
|
<% } %>
|
|
<% }); %>
|
|
<% }); %>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
<% }); %>
|
|
<% } %>
|