-
Notifications
You must be signed in to change notification settings - Fork 46
/
feed.xml
77 lines (77 loc) · 4.03 KB
/
feed.xml
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
72
73
74
75
76
77
---
layout: none
---
{%- assign lastPost = 'now' | date: "%s" -%}
{%- assign cases = site.cases | reverse -%}
{%- assign guids = "" | split: "" -%}
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title | xml_escape }}</title>
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
<link>https://csirt.divd.nl</link>
<atom:link href="https://csirt.divd.nl/feed.xml" rel="self" type="application/rss+xml" />
{%- for post in site.posts limit:10 %}
{%- assign postDate = post.date | date: "%s" %}
{%- for c in cases %}
{%- assign caseStart = c.start | date: "%s" %}
{%- assign caseEnd = c.end | date: "%s" %}
{%- assign lastEvent = c.timeline | last %}
{%- assign caseLast = lastEvent.start | date: "%s" %}
{%- if caseEnd >= postDate and caseEnd < lastPost %}
{%- if guids contains c.url -%}
{%- else -%}
<item>
<title>Case closed: {{ c.title | xml_escape }}</title>
<description>
{{ c.excerpt | markdownify | xml_escape }}
</description>
<pubDate>{{ caseEnd | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>https://csirt.divd.nl{{ c.url }}</link>
<guid isPermaLink="true">https://csirt.divd.nl{{ c.url }}</guid>
</item>
{%- assign guids = guids | push: c.url -%}
{%- endif -%}
{%- endif %}
{%- if caseLast >= postDate and caseLast < lastPost %}
{%- if guids contains c.url -%}
{%- else -%}
<item>
<title>Case update: {{ c.title | xml_escape }}</title>
<description>
Last event: {{ caseLast | date: "%d %b %Y" }} - {{ lastEvent.event | xml_escape }}
</description>
<pubDate>{{ caseLast | date: "%d %b %Y %H:%M:%S %z" }}</pubDate>
<link>https://csirt.divd.nl{{ c.url }}</link>
<guid isPermaLink="true">https://csirt.divd.nl{{ c.url }}</guid>
</item>
{%- assign guids = guids | push: c.url -%}
{%- endif -%}
{%- endif %}
{%- if caseStart >= postDate and caseStart < lastPost %}
{%- if guids contains c.url -%}
{%- else -%}
<item>
<title>Case opened: {{ c.title | xml_escape }}</title>
<description>
{{ c.excerpt | markdownify | xml_escape }}
</description>
<pubDate>{{ caseStart | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>https://csirt.divd.nl{{ c.url }}</link>
<guid isPermaLink="true">https://csirt.divd.nl{{ c.url }}</guid>
</item>
{%- assign guids = guids | push: c.url -%}
{%- endif -%}
{%- endif %}
{%- endfor %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.content | markdownify | xml_escape }}</description>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>https://csirt.divd.nl{{ post.url }}</link>
<guid isPermaLink="true">https://csirt.divd.nl{{ post.url }}</guid>
</item>
{%- assign lastPost = postDate | date: "%s" %}
{%- endfor %}
</channel>
</rss>