-
Notifications
You must be signed in to change notification settings - Fork 2
/
latest.html
71 lines (63 loc) · 2.89 KB
/
latest.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
layout: page
nav-title: News
title: Bounty Feed
---
{% assign raw_gmc_posts=site.data.gmc-rss | where_exp: "item", "item.title contains 'Round'" %}
{% assign raw_bounties=site.pages | where:"layout", "bounty" %}
{% assign display_dates = '' | split: '' %}
<!-- Add dates of GMC posts from rss. -->
{% for post in raw_gmc_posts %}
{% assign date=post.pubDate | date_to_string: "ordinal", "US" %}
{% assign date=date | date_to_xmlschema %}
{% if post.title contains 'Community Discussion' %}
{% assign display_dates=display_dates | push: date %}
{% elsif post.title contains 'Results' %}
{% assign display_dates=display_dates | push: date %}
{% elsif post.title contains 'Bounty Applications' %}
{% assign display_dates=display_dates | push: date %}
{% endif %}
{% endfor %}
<!-- Add dates of Bounties from repo. -->
{% for bounty in raw_bounties %}
{% if bounty.creation-date != nil %}
{% assign date=bounty.creation-date | date_to_string: "ordinal", "US" %}
{% assign date=date | date_to_xmlschema %}
{% assign display_dates=display_dates | push: date %}
{% endif %}
{% endfor %}
<!-- Important to make sure dates are in the same format, hence all the conversion. Format conversion also removes timestamps that would otherwise cause duplicates. Can only sort in YYYY-MM-DD format. -->
<!-- Remove uniques -->
{% assign display_dates = display_dates | uniq | sort | reverse %}
<!-- Actually render stuff for each date. -->
{% for date in display_dates %}
<div class="feed-item-container">
<!-- Date header -->
<h3>{{date | date_to_string: "ordinal", "US"}}</h3>
<!-- GMC Posts -->
{% for post in raw_gmc_posts %}
{% assign post_date=post.pubDate | date_to_string: "ordinal", "US" %}
{% assign post_date=post_date | date_to_xmlschema %}
{% if post_date == date %}
{% assign postTitle = post.title | truncate: 8, "" %}
{% if post.title contains 'Community Discussion' %}
<span><a href="{{post.link}}">Forum Post</a> - {{postTitle}} Proposal Discussion</span><br/>
{% elsif post.title contains 'Results' %}
<span><a href="{{post.link}}">Forum Post</a> - {{postTitle}} Grant, Retro and Bounty Results</span><br/>
{% elsif post.title contains 'Bounty Applications' %}
<span><a href="{{post.link}}">Forum Post</a> - {{postTitle}} Call for Bounty Proposals</span><br/>
{% endif %}
{% endif %}
{% endfor %}
<!-- Bounties -->
{% for bounty in raw_bounties %}
{% if bounty.creation-date != nil %}
{% assign bounty_date=bounty.creation-date | date_to_string: "ordinal", "US" %}
{% assign bounty_date=bounty_date | date_to_xmlschema %}
{% if bounty_date == date %}
<span><a href="{{bounty.url|relative_url}}">Bounty Added</a> - {{bounty.title}}</span><br/>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endfor %}