-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.xslt.xml
60 lines (60 loc) · 2.98 KB
/
feed.xslt.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
permalink: /feed.xslt.xml
sitemap: false
layout: none
---
<?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">
<xsl:output method="html" encoding="UTF-8" indent="yes" doctype-system="about:legacy-compat" />
<xsl:template match="/">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Feed {{ site.title_separator | default: '|' }} <xsl:value-of select="/atom:feed/atom:title" /></title>
<xsl:text disable-output-escaping="yes"><link rel="icon" type="image/webp" href="</xsl:text>
<xsl:value-of select="/atom:feed/atom:icon" />
<xsl:text disable-output-escaping="yes">" /></xsl:text>
<xsl:text disable-output-escaping="yes"><meta name="author" content="</xsl:text>
<xsl:value-of select="/atom:feed/atom:author/atom:name" />
<xsl:text disable-output-escaping="yes">" /></xsl:text>
<xsl:text disable-output-escaping="yes"><link rel="canonical" href="</xsl:text>
<xsl:value-of select="/atom:feed/atom:link[2]/@href" />
<xsl:text disable-output-escaping="yes">" /></xsl:text>
<style>
:root { color-scheme: light dark; }
html {
max-width: 60rem;
margin: 0 auto;
padding: 1em;
font: 1rem / 1.5 sans-serif;
}
h2 { margin-bottom: 0; }
h3 { margin-top: 0; }
ul { list-style-type: none; padding-left: 0; }
li { margin: 0.5rem 0; }
@media (prefers-color-scheme: dark) {
html { background-color: black; color: white; }
a { color: lightskyblue; }
a:visited { color: plum; }
}
</style>
</head>
<body>
<p><strong>This is an Atom feed, also called an RSS feed</strong>. With the right software, you can use this URL to be told when this website updates while the content is delivered to you automatically. Visit <a href="https://aboutfeeds.com/">About Feeds ↗︎</a> to learn more and get started. It’s free.</p>
<h1>Feed Preview</h1>
<h2><xsl:value-of select="/atom:feed/atom:title" /></h2>
<h3><xsl:value-of select="/atom:feed/atom:subtitle" /></h3>
<p><a><xsl:attribute name="href"><xsl:value-of select="/atom:feed/atom:link[2]/@href" /></xsl:attribute>Visit the website of this feed →</a></p>
<h2>Posts</h2>
<ul>
<xsl:for-each select="/atom:feed/atom:entry">
<li>
<time><xsl:attribute name="datetime"><xsl:value-of select="atom:published" /></xsl:attribute><xsl:value-of select="substring(atom:published, 0, 11)" /></time> 
<a><xsl:attribute name="href"><xsl:value-of select="atom:link/@href" /></xsl:attribute><xsl:value-of select="atom:title" /></a>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>