From d59b6e1f7a7915f6435266db00876a8702bfc6c1 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Wed, 24 Apr 2024 17:31:32 -0500 Subject: [PATCH] Adds XSL stylesheet for better Atom feed preview! --- content/feed/atom.njk | 1 + content/feed/pretty-atom-feed.xsl | 89 +++++++++++++++++++++++++++++++ eleventy.config.js | 2 + 3 files changed, 92 insertions(+) create mode 100644 content/feed/pretty-atom-feed.xsl diff --git a/content/feed/atom.njk b/content/feed/atom.njk index dfa034b..d8f8688 100755 --- a/content/feed/atom.njk +++ b/content/feed/atom.njk @@ -6,6 +6,7 @@ eleventyNavigation: order: 3 --- + {{ metadata.title }} {{ metadata.description }} diff --git a/content/feed/pretty-atom-feed.xsl b/content/feed/pretty-atom-feed.xsl new file mode 100644 index 0000000..6a1c4de --- /dev/null +++ b/content/feed/pretty-atom-feed.xsl @@ -0,0 +1,89 @@ + + + + + + + + <xsl:value-of select="atom:feed/atom:title"/> + + + + + + +
+
+

+ + + + + + + + + + + + + + + + + + + Web Feed Preview +

+

+

+

This preview only shows titles, but the actual feed contains the full content.

+ + + + + Visit Website → + +
+

Recent Items

+ +
+ + +
+ +
+

+ + + + + + +

+ + Published: + +
+
+
diff --git a/eleventy.config.js b/eleventy.config.js index 2b21b1c..35e3e9d 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -17,6 +17,8 @@ export default async function(eleventyConfig) { "./node_modules/prismjs/themes/prism-okaidia.css": "/css/prism-okaidia.css" }); + eleventyConfig.addPassthroughCopy("./content/feed/pretty-atom-feed.xsl"); + // Run Eleventy when these files change: // https://www.11ty.dev/docs/watch-serve/#add-your-own-watch-targets