-
Notifications
You must be signed in to change notification settings - Fork 0
/
news.html
38 lines (32 loc) · 1.12 KB
/
news.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
---
title: News!
layout: news
---
<h1>News</h1>
<div class='grid_24'>
{% for post in site.posts %}
{% comment %} ### Generate monthly heading for first post in a month ### {% endcomment %}
{% capture cmonth %}{{ post.date | date: "%B" }}{% endcapture %}
{% unless lmonth == cmonth %}
<h2 id="{{ post.date | date: '%Y%m' }}" style="color: black"> {{ post.date | date: '%B %Y' }}</h2>
{% assign lmonth = cmonth %}
{% endunless %}
<div class='section-grouping'>
{% comment %} ### Count the number of posts for the day ### {% endcomment %}
{% capture thisdate %}{{ post.date | date: "%Y%m%d" }}{% endcapture %}
{% if thisdate != lastdate %}
{% assign postindex = '1' %}
{% assign lastdate = thisdate %}
{% else %}
{% capture postindex %}{{ postindex | plus: '1' }}{% endcapture %}
{% endif %}
{% comment %} ### Output the post title with a unique date based id ### {% endcomment %}
<h2 id='{{ thisdate }}0{{postindex}}'>
{{ post.date | date: '%A, %d %B %Y' }} : {{post.title}}
</h2>
{{ post.content }}
</div>
<br/>
{% endfor %}
</div>
<!-- End of iterator -->