summaryrefslogtreecommitdiff
path: root/themes/hexo-theme-freemind.bithack/layout/categories.ejs
blob: 83af3e70e2761cacea2a9e86b565c4b09fc1f5b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!-- title -->
<div class="page-header">
	 <h1><i class="fa fa-folder"></i> <%= page.title %></h1>
</div>

<div class="row page"> 

	<% if (theme.widgets.length) { %>
	    <div class="col-md-9">
	<% } else { %>
	    <div class="col-md-12">
	<% } %>

	<div id="top_search"></div>

    <% if (site.categories.length) { %>
        <div class="widget">
			<ul class="tag_box inline list-unstyled">
			<% site.categories.sort('name').each(function(item){ %>
				<li><a href="#<%= item.name %>"><%= item.name %><span><%= item.posts.length %></span></a></li>
			<% }); %>
			</ul>
		</div>
		
        <div class="archive">
		    <% site.categories.sort('name').each(function(item){ %>
		    <h4 class="archive-ul show" data-toggle="collapse" id="<%= item.name %>" data-target="#modal-<%= item.name %>"> <%= item.name %> <b class="caret"></b></h4>
		    <ul id="modal-<%= item.name %>" class="collapse in">

		        <% site.posts.sort('date', -1).forEach(function(it){ %>
			        <% if (it.categories.length == 1 && it.categories.data[0]._id == item._id){ %>
		   	        <li class="listing-item"><a href="<%= config.root %><%= it.path %>" <% if (it.description) { %> title="<%= it.description %>" <% } %>><%= it.title %></a></li>
			        <% } %>
		        <% }); %>
		   </ul>
		   <% }); %>
		   </ul>
        </div>
    <% } %>

</div> <!-- col-md-9 -->

   <% if (theme.widgets.length) { %>
	   <%- partial('_partial/sidebar') %>
   <% } %>

</div> <!-- row-fluid -->