blob: a5f3c0821abf71ea433af71157a68103d8ad2737 [file] [log] [blame]
<% var result = page.path.match(/(v-)(\d+(\.\d+))/) %>
<% var version = result ? +result[2] : 2.1 %>
<div class="summary">
<ul class="doc-summary">
<% var pagesArr = site.pages.find({type: type, lang: page.lang, version: version}).sort('order') %>
<% var pages = [] %>
<% pagesArr.each(function (item) { %>
<% var i = Math.floor(item.order) - 1 %>
<% if(pages[i]) { %>
<% pages[i].push(item) %>
<% } else { %>
<% pages[i] = [];pages[i].push(item) %>
<% } %>
<% }) %>
<% pages.forEach(function (item, index) { %>
<li>
<h3 class="chapter-title">
<% var find = _.find(item, {title: item[0].group}) %>
<% if(find && !_.isEmpty(find)){ %>
<a class="sidebar-link" href="<%= url_for(find.path) %>"><%- find.title %></a>
<% } else { %>
<span class="sidebar-link"><%- item[0].group %></span>
<% } %>
</h3>
<% if (item.length > 0) { %>
<ul class="chapter">
<% for (var i = 0; i < item.length; i++) { %>
<% if(item[i].title !== item[0].group){ %>
<li>
<a href="<%= url_for(item[i].path) %>" class="sidebar-link <%- is_current(item[i].path, 'strict') ? 'current' : '' %> <%- item[i].is_new ? 'new' : '' %>"><%= item[i].title %></a>
</li>
<% } %>
<% } %>
</ul>
<% } %>
</li>
<% }) %>
</ul>
</div>