Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new RSS feed for security advisories #243

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ module.exports = function(eleventyConfig) {
});
})

eleventyConfig.addCollection("recentWSAs", (collectionApi) => {
let i = 0;
return collectionApi.getFilteredByTag("WSA").reverse().filter((item) => {
return i++ < 6;
});
})

eleventyConfig.addCollection("pkgCatalog", collection => {
let pkgCatalog = new Object;
collection.getAll().forEach(item => {
Expand Down
5 changes: 3 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
<meta name="description" content="{{ page_description | escape }}">
{%- endif %}
<link rel="canonical" href="{{ page.url | replace:'index.html','' | htmlBaseUrl: site.base_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ '/feed.xml' | htmlBaseUrl: site.base_url }}">
<link rel="alternate" type="application/rss+xml" title="WPE blog" href="{{ '/blog.xml' | htmlBaseUrl: site.base_url }}">
<link rel="alternate" type="application/rss+xml" title="WPE WebKit Blog" href="{{ '/blog.xml' | htmlBaseUrl: site.base_url }}">
<link rel="alternate" type="application/rss+xml" title="WPE WebKit Posts" href="{{ '/feed.xml' | htmlBaseUrl: site.base_url }}">
<link rel="alternate" type="application/rss+xml" title="WPE WebKit Security Advisories" href="{{ '/security.xml' | htmlBaseUrl: site.base_url }}">

{%- comment %}
<!-- OpenGraph metadata, see https://ogp.me -->
Expand Down
31 changes: 31 additions & 0 deletions security.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---json
{
"eleventyExcludeFromCollections": true,
"permalink": "/security.xml",
"metadata": {
"title": "WPE WebKit Security Advisories",
"description": "WebKit Security Advisories from wpewebkit.org",
"url": "https://wpewebkit.org/security/",
"feedUrl": "https://wpewebkit.org/security.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.recentWSAs | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ metadata.url }}</id>
{%- for post in collections.recentPosts %}
{% 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>