summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2025-08-21 18:20:39 -0500
committerMark Powers <mark@marks.kitchen>2025-08-21 18:20:39 -0500
commitd99ff3c4026322b2456f6dc45f8184ce18c94a48 (patch)
treec8e554f7342d1b7f11a514b1a7e6fbec9e51eb11
parent2390a83cd7a3ee1915026c9993570b20c65fb74d (diff)
Add RSS styling
-rw-r--r--layouts/_default/rss.xml7
-rw-r--r--static/rss.xsl47
2 files changed, 51 insertions, 3 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index c6b7f31..f9b9c66 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -11,6 +11,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
+{{- printf "<?xml-stylesheet href=\"/rss.xsl\" type=\"text/xsl\" media=\"screen\" ?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
@@ -27,14 +28,14 @@
{{- end -}}
{{ range $pages }}
{{if compare.Eq .Section "blog"}}
- <item>
+ <item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
- <description>{{ .Summary | html }}</description>
- </item>
+ <description>{{ .Summary }}</description>
+ </item>
{{ end }}
{{ end }}
</channel>
diff --git a/static/rss.xsl b/static/rss.xsl
new file mode 100644
index 0000000..5c919a6
--- /dev/null
+++ b/static/rss.xsl
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
+ <xsl:template match="/">
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+ <title>Marks' Kitchen Feed</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
+ <link media="screen" rel="stylesheet" href="/css/common.css" />
+ </head>
+ <body>
+ <h1>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="/rss/channel/link"/>
+ </xsl:attribute>
+ <xsl:value-of select="/rss/channel/title"/>
+ RSS Feed
+ </a>
+ </h1>
+ <p>This page is automatically generated. Use it with an RSS reader to fetch site updates.</p>
+ <p><xsl:value-of select="/rss/channel/description"/></p>
+ <ul>
+ <xsl:for-each select="/rss/channel/item">
+ <li>
+ <h2>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="guid"/>
+ </xsl:attribute>
+ <xsl:value-of select="title"/>
+ -
+ <xsl:value-of select="pubDate" />
+ </a>
+ </h2>
+ <xsl:value-of select="description" />
+ </li>
+ </xsl:for-each>
+ </ul>
+ </body>
+ </html>
+ </xsl:template>
+</xsl:stylesheet> \ No newline at end of file