Skip to content

Commit d9e8c29

Browse files
author
Scott Cranfill
committed
Create article archive page
1 parent 6f73146 commit d9e8c29

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed

_layouts/post.html

+5-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h4 class="tags_head">Tags:</h4>
4848
<h2 class="sidebar_head">More articles</h2>
4949

5050
<ul class="sidebar_list nav-list">
51-
{% for post in site.posts limit:10 %}
51+
{% for post in site.posts limit:5 %}
5252
<li class="sidebar_list_item">
5353
<h3 class="sidebar_list_item_head">
5454
<a href="../../{{ post.url | remove_first:'/'}}">
@@ -71,11 +71,10 @@ <h3 class="sidebar_list_item_head">
7171
{% endfor %}
7272
</ul>
7373

74-
<!-- Hide until we have published at least 4 articles -->
75-
<!-- <a class="more-articles_read-more-link call-to-action__icon"
76-
href="../../articles/">
77-
Read more articles <i class="icon-right"></i>
78-
</a> -->
74+
<a class="call-to-action"
75+
href="../">
76+
View full archive
77+
</a>
7978
</div>
8079
</section>
8180
</div>

articles/index.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
published: true
3+
layout: page
4+
author:
5+
title: "Article archive"
6+
permalink: /articles/
7+
---
8+
9+
<ul class="nav-list">
10+
{% for post in site.posts %}
11+
<li class="sidebar_list_item">
12+
<h3 class="sidebar_list_item_head">
13+
<a href="../../{{ post.url | remove_first:'/'}}">
14+
{{ post.title }}
15+
</a>
16+
</h3>
17+
18+
<div class="sidebar_list_item_meta entry_meta">
19+
{% if post.author %}
20+
By <span class="author">{{ post.author }}</span> &ndash;
21+
{% endif %}
22+
23+
{% if post.date %}
24+
<time datetime="{{ post.date | date: '%b %d, %Y' }}">
25+
{{ post.date | date: '%b %d, %Y' }}
26+
</time>
27+
{% endif %}
28+
</div>
29+
</li>
30+
{% endfor %}
31+
</ul>

index.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,10 @@ <h3 class="sidebar_list_item_head">
165165
{% endfor %}
166166
</ul>
167167

168-
<!-- Hide until we have published at least 4 articles -->
169-
<!-- <a class="more-articles_read-more-link call-to-action__icon"
168+
<a class="call-to-action"
170169
href="articles/">
171-
Read more articles <i class="icon-right"></i>
172-
</a> -->
170+
View full archive
171+
</a>
173172
</section>
174173
</section>
175174

0 commit comments

Comments
 (0)