Skip to content

Commit

Permalink
add archive
Browse files Browse the repository at this point in the history
  • Loading branch information
casutton committed May 30, 2017
1 parent 0ace78f commit 7a81eac
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 3 deletions.
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
</div>

<nav>
<a href="{{ site.baseurl }}/archive">Archive</a>
<a href="{{ site.baseurl }}/about">About</a>
</nav>
</header>
Expand Down
28 changes: 28 additions & 0 deletions archive/by-tag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: page
---

<div class="row">

<div class="col-xs-1">&nbsp;</div>

<div class="col-xs-10">
<h1>All Topics</h1>

<p>
The entire blog, organized by tag. You may prefer to see these
organized <a href="/archive/">by year</a>.
</p>

<ul class="post-archive-list">
{% assign sorted_tags = site.tags | sort %}
{% for tag in sorted_tags %}
{% if tag[0] != 'popular' %}
{% assign tag_len = tag[1].size %}
<li class="post-archive-item"><a href="/tag/{{tag[0]}}">{{ tag[0] }}</a> ({{ tag_len }})</li>
{% endif %}
{% endfor %}
</ul>

</div>
</div>
31 changes: 31 additions & 0 deletions archive/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: page
---

<div class="row">

<div class="col-xs-1">&nbsp;</div>

<div class="col-xs-10">

<h1>All Posts</h1>

<p class="archive-paragraph">
The entire blog, by year. You may prefer to see these
organized <a href="by-tag.html">by tag</a>.
</p>

{% for post in site.posts %}
{% assign currentdate = post.date | date: "%Y" %}
{% if currentdate != date %}
{% unless forloop.first %}</ul>{% endunless %}
<h2 id="y{{post.date | date: "%Y"}}">{{ currentdate }}</h2>
<ul class="post-archive-list">
{% assign date = currentdate %}
{% endif %}
<li class="post-archive-item"><a href="{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}

</div>
</div>
11 changes: 8 additions & 3 deletions style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ h1 {
}

h2 {
font-size: 24px;
font-size: 20px;
}

h3 {
font-size: 20px;
font-size: 18px;
}

h4 {
font-size: 18px;
font-size: 16px;
color: $gray;
}

Expand Down Expand Up @@ -331,6 +331,11 @@ div.next_post { float: right; text-align: right; }
.poem { padding-left: 10px; }
.poem-attribution { padding-left: 60px; }

// special things for the all-posts page
.post-archive-list { list-style: none; }
.post-archive-item { padding-top: 3px; padding-bottom: 3px; }
.archive-paragraph { margin-top: 0px; padding-bottom: 6px; }

// Settled on moving the import of syntax highlighting to the bottom of the CSS
// ... Otherwise it really bloats up the top of the CSS file and makes it difficult to find the start
@import "highlights";
Expand Down

0 comments on commit 7a81eac

Please sign in to comment.