Skip to content

Commit

Permalink
Add blog feed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrego authored and aperezdc committed Apr 25, 2022
1 parent fb6f6f7 commit 1eab83d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ and the Web platform. Also check out [the official WebKit blog](https://webkit.o
</ol>
</div>
<br>
<a href="{{ '/blog.xml' | url }}"><i class="icon-feed"></i>&nbsp;&nbsp;Feed</a>
31 changes: 31 additions & 0 deletions blog.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---json
{
"eleventyExcludeFromCollections": true,
"permalink": "/blog.xml",
"metadata": {
"title": "WPE WebKit Blog",
"description": "News related to WPE WebKit.",
"url": "https://wpewebkit.org/blog/",
"feedUrl": "https://wpewebkit.org/blog.xml"
}
}
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ metadata.title }}</title>
<description>{{ metadata.description }}</description>
<link href="{{ metadata.feedUrl }}" rel="self"/>
<link href="{{ metadata.url }}"/>
<updated>{{ collections.recentBlogPosts | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ metadata.url }}</id>
{%- for post in collections.recentBlogPosts %}
{% set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset %}
<entry>
<title>{{ post.data.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<updated>{{ post.date | dateToRfc3339 }}</updated>
<id>{{ absolutePostUrl }}</id>
<content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry>
{%- endfor %}
</feed>

0 comments on commit 1eab83d

Please sign in to comment.