Skip to content

Commit e08fd1f

Browse files
committed
feat: add rss styles
1 parent a03c40b commit e08fd1f

File tree

5 files changed

+81
-2
lines changed

5 files changed

+81
-2
lines changed

.changeset/blue-ways-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"r.obin.ch": patch
3+
---
4+
5+
Add RSS styles

public/rss-tile.svg

Lines changed: 1 addition & 0 deletions
Loading

public/rss.xslt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheet version="3.0"
3+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4+
xmlns:atom="http://www.w3.org/2005/Atom">
5+
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6+
<xsl:template match="/">
7+
<xsl:variable name="owner_url"><xsl:value-of select="/rss/channel/link"/></xsl:variable>
8+
<html>
9+
<head>
10+
<meta name="viewport" content="width=device-width, initial-scale=1" />
11+
<meta name="referrer" content="unsafe-url" />
12+
<title><xsl:value-of select="/rss/channel/title"/></title>
13+
<link rel="stylesheet" href="/water.min.css" />
14+
</head>
15+
<body>
16+
<h1>
17+
<img alt="feed icon" src="/rss-tile.svg" style="height:1em;vertical-align:middle;" />&#xa0;
18+
<xsl:value-of select="/rss/channel/title"/>
19+
</h1>
20+
21+
<p>
22+
<xsl:value-of select="/rss/channel/description"/>
23+
</p>
24+
25+
<p>This is the RSS&#xa0;<a href="https://www.rss.style/what-is-a-feed.html">news feed</a>&#xa0;for the&#xa0;
26+
<a><xsl:attribute name="href">
27+
<xsl:value-of select="/rss/channel/link"/>
28+
</xsl:attribute>
29+
<xsl:value-of select="/rss/channel/title"/></a>&#xa0;
30+
website.
31+
</p>
32+
33+
<p>It is meant for&#xa0;<a href="https://www.rss.style/newsreaders.html">news readers</a>, not humans. Please copy-and-paste the URL into your news reader!</p>
34+
35+
<p>
36+
<pre>
37+
<code id="feedurl"><xsl:value-of select="/rss/channel/atom:link/@href"/></code>
38+
</pre>
39+
<button
40+
class="clipboard"
41+
data-clipboard-target="#feedurl">
42+
Copy to clipboard
43+
</button>
44+
</p>
45+
46+
<xsl:for-each select="/rss/channel/item">
47+
<details><summary>
48+
<a>
49+
<xsl:attribute name="href">
50+
<xsl:value-of select="link"/>
51+
</xsl:attribute>
52+
<xsl:value-of select="title"/>
53+
</a>&#xa0;-&#xa0;
54+
<xsl:value-of select="pubDate" />
55+
</summary>
56+
<xsl:value-of select="description" disable-output-escaping="yes" />
57+
</details>
58+
</xsl:for-each>
59+
<p><xsl:value-of select="count(/rss/channel/item)"/> news items.</p>
60+
<p><small>Powered by <a href="https://www.rss.style/"><img alt="RSS.Style" referrerpolicy="origin" src="https://www.rss.style/favicon.svg" style="height:1em;padding-right:0.25em;vertical-align:middle;" />RSS.Style</a></small></p>
61+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
62+
<script>
63+
new ClipboardJS('.clipboard');
64+
</script>
65+
</body>
66+
</html>
67+
</xsl:template>
68+
</xsl:stylesheet>

0 commit comments

Comments
 (0)