generated from Nereare/Template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathposts_collection.html
47 lines (45 loc) · 1.54 KB
/
posts_collection.html
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
---
layout: default
---
{% assign: posts = site.posts | join: '' %}
{% if posts != '' %}
<h1>Posts</h1>
<nav class="posts">
<ul class="columns">
<li class="four columns"><button class="u-full-width button-primary" id="go-alphabetical">Alphabetical</button></li>
<li class="four columns"><button class="u-full-width" id="go-tags">Tags</button></li>
<li class="four columns"><button class="u-full-width" id="go-categories">Categories</button></li>
</ul>
</nav>
<div class="collection" id="alphabetical">
<ul>
{% for post in site.posts %}
<li><strong><a href="{{ post.url }}">{{ post.title }}</a>:</strong> {{ post.excerpt | strip_html | truncatewords: 50 }}</li>
{% endfor %}
</ul>
</div>
<div class="collection" id="tags">
<h2>Tags</h2>
{% for tag in site.tags %}
<h3>{{ tag[0] }}</h3>
<ul>
{% for post in tag[1] %}
<li><strong><a href="{{ post.url }}">{{ post.title }}</a>:</strong> {{ post.excerpt | strip_html | truncatewords: 50 }}</li>
{% endfor %}
</ul>
{% endfor %}
</div>
<div class="collection" id="categories">
<h2>Categories</h2>
{% for cat in site.categories %}
<h3>{{ cat[0] }}</h3>
<ul>
{% for post in cat[1] %}
<li><strong><a href="{{ post.url }}">{{ post.title }}</a>:</strong> {{ post.excerpt | strip_html | truncatewords: 50 }}</li>
{% endfor %}
</ul>
{% endfor %}
</div>
{% endif %}
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script type="text/javascript" src="/assets/posts_collection.js"></script>