Skip to content

Commit

Permalink
Style RSS feed
Browse files Browse the repository at this point in the history
  • Loading branch information
whitep4nth3r committed Jul 8, 2024
1 parent 530faa6 commit 401d9cc
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({ "./src/_css/": "/css/" });
eleventyConfig.addPassthroughCopy({ "./src/_fonts": "/fonts" });
eleventyConfig.addPassthroughCopy({ "./src/_public": "/" });
eleventyConfig.addPassthroughCopy({ "./_headers": "/" });
eleventyConfig.addPassthroughCopy({
"./src/_client_scripts/app_search.js": "/js/app_search.js",
});
Expand Down
4 changes: 4 additions & 0 deletions _headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# RSS Styles:
/feed.xml
Content-Type: application/xml; charset=utf-8
x-content-type-options: nosniff
141 changes: 141 additions & 0 deletions src/_css/rss-style.xsl

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/_rss/rss.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ exports.render = function (data) {
const { sortedItems } = data;

return /* xml */ `<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/css/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
xmlns:atom="https://www.w3.org/2005/Atom"
xmlns:content="https://purl.org/rss/1.0/modules/content/">
<channel>
<title>${Config.site.title} RSS Feed</title>
<title>whitep4nth3r's Web Feed</title>
<atom:link href="https://${Config.site.domain}/feed.xml" rel="self" type="application/rss+xml" />
<link>https://${Config.site.domain}</link>
<description>Posts, talks and more about web development, accessibility, Jamstack, JavaScript, and more from whitep4nth3r.</description>
<description>Hello, I'm Salma. I write code for your entertainment. I help developers build cool stuff with blog posts, videos, live coding and open source projects. I work at Sentry. I like to think I'm kinda cool.</description>
${buildRssItems(sortedItems)}
</channel>
</rss>
Expand Down

0 comments on commit 401d9cc

Please sign in to comment.