Commit 17eea76a authored by Olga Brani's avatar Olga Brani

Archive posts list with years/months separation

parent 7072c1b1
......@@ -14,7 +14,7 @@ layoutCls: x-wide
{% endif %}
{% endfor %}
{% if tag %}
{% capture tags_content_temp %}{{ tags_content }}<a href="/blog/tag/{{ tag.slug }}/" class="label">{{ tag.name }}</a>{% if forloop.last == false %}, {% endif %}{% endcapture %}
{% capture tags_content_temp %}{{ tags_content }}<a href="/blog/tag/{{ tag.slug }}/">{{ tag.name }}</a>{% if forloop.last == false %}, {% endif %}{% endcapture %}
{% assign tags_content = tags_content_temp %}
{% endif %}
{% endfor %}
......@@ -39,18 +39,43 @@ layoutCls: x-wide
{{content}}
</div>
<div class="small-4 columns sidemenu">
<p><strong><a href="{{site.baseurl}}/blog/">All Posts</a></strong></p>
<ul>
{% for post in site.posts %}
{% if page.url == post.url%}
<div class="small-4 columns sidemenu archive">
<p><strong><a href="{{site.baseurl}}/blog/">Posts Archive</a></strong></p>
{%for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%b" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture next_month %}{{ post.previous.date | date: "%b" }}{% endcapture %}
{% if forloop.first %}
<h2 id="{{ this_year }}-ref">{{this_year}}</h2>
<h3 id="{{ this_year }}-{{ this_month }}-ref">[{{ this_month }}]</h3>
<ul>
{% endif %}
{% if page.url == post.url %}
<li class="active">
{% else %}
<li>
{% endif %}
<span class="date">[{{ post.date | date: "%b %Y" }}]</span> <a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
<a href="{{ post.url | prepend:site.baseurl}}">{{ post.title }}</a>
</li>
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != next_year %}
</ul>
<h2 id="{{ next_year }}-ref">{{next_year}}</h2>
<h3 id="{{ next_year }}-{{ next_month }}-ref">[{{ next_month }}]</h3>
<ul>
{% else %}
{% if this_month != next_month %}
</ul>
<h3 id="{{ this_year }}-{{ next_month }}-ref">[{{ next_month }}]</h3>
<ul>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</ul>
</div>
</div>
......@@ -337,6 +337,7 @@ header {
.sidemenu {
ul {
margin-left: 0;
font-size: emCalc(14px);
li {
&.active {
a {
......@@ -344,7 +345,7 @@ header {
}
}
list-style: none outside none;
padding: 0 0 10px 0;
padding: 0 0 5px 0;
.date {
font-size: emCalc(14px);
margin-bottom: 0em;
......@@ -352,5 +353,19 @@ header {
}
}
}
h2 {
font-size: emCalc(20px);
}
h3 {
font-size: emCalc(14px);
color: lighten($body-font-color, 15%);
font-weight: normal;
}
&.archive {
ul {
margin: 0 0 0 0.5em;
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment