Skip to content

Commit 2111467

Browse files
authored
Merge pull request #241 from remotehack/ben/previous-hack-feed
Serve previous hacks as rss feed
2 parents f2db3d0 + 8381354 commit 2111467

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

_layouts/default.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77

88
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Space+Mono:wght@400&display=swap"
99
rel="stylesheet">
10-
11-
<link rel="alternate" type="application/rss+xml" title="RSS Feed for remotehack.space" href="/live/feed/" />
1210
<link rel="stylesheet" href="/assets/style.css">
1311

12+
<link rel="alternate" type="application/rss+xml" title="remotehack - Airquotes The Pocast Airquotes" href="/live/feed/" />
13+
<link rel="alternate" type="application/rss+xml" title="remotehack - Hacks" href="/feed.xml" />
14+
1415
<!-- favicon images -->
1516
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png">
1617
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png">

pages/feed.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: null
3+
permalink: /feed.xml
4+
---
5+
<?xml version="1.0" encoding="UTF-8"?>
6+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
7+
<channel>
8+
<title>{{ site.title }}</title>
9+
<description>{{ site.description }}</description>
10+
<link>{{site.url
11+
}}</link>
12+
<atom:link href="{{ site.url }}/feed.xml" rel="self"
13+
type="application/rss+xml" />
14+
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
15+
<pubDate>{{site.time
16+
| date_to_rfc822 }}</pubDate>
17+
<ttl>60</ttl> {% assign sorted_hacks = site.hacks |
18+
where:"upcoming",false | sort:"date" | reverse %} {% for hack in sorted_hacks %} <item>
19+
<title>{{ hack.title }}</title>
20+
<description>{{ hack.content | xml_escape }}</description>
21+
<link>{{ site.url }}{{ hack.url }}</link>
22+
<guid isPermaLink="true">{{ site.url }}{{ hack.url }}</guid>
23+
<pubDate>{{ hack.date | date_to_rfc822 }}</pubDate>
24+
</item> {% endfor %} </channel>
25+
</rss>

0 commit comments

Comments
 (0)