-
Notifications
You must be signed in to change notification settings - Fork 1
/
feed.xsl
89 lines (82 loc) · 3.4 KB
/
feed.xsl
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
---
<!--
Based on
https://gist.github.com/andrewstiefel/57a0a400aa2deb6c9fe18c6da4e16e0f
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom"
exclude-result-prefixes="atom">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title><xsl:value-of select="atom:feed/atom:title" /> | RSS</title>
<link rel="stylesheet" href="/assets/main.css" />
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/favicon-16x16.png" />
<link rel="manifest" href="/assets/images/site.webmanifest" />
<link rel="mask-icon" href="/assets/images/safari-pinned-tab.svg" color="#008000" />
<link rel="shortcut icon" href="/assets/images/favicon.ico" />
<meta name="msapplication-TileColor" content="#ffc40d" />
<meta name="msapplication-config" content="/assets/images/browserconfig.xml" />
<meta name="theme-color" content="#ffffff" />
</head>
<body>
{%- include header.html -%}
<main class="page-content">
<div class="wrapper">
<xsl:apply-templates select="atom:feed" />
<ul class="atom-post-list">
<xsl:apply-templates select="atom:feed/atom:entry" />
</ul>
</div>
</main>
<!--
TODO: Cannot include footer because it uses XML namespaces internally
that cause the styled XML feed to fail to render.
{%- include footer.html -%}
-->
</body>
</html>
</xsl:template>
<xsl:template match="atom:feed">
<article class="post">
<header class="post-header">
<h1 class="post-title">Web feed preview</h1>
</header>
<div class="post-content">
<p>This is a web feed, also known as an RSS feed, for the <a>
<xsl:attribute name="href">
<xsl:value-of select="atom:link[@rel='alternate']/@href" />
</xsl:attribute>
<xsl:value-of select="atom:title" />
</a> blog. You can subscribe by copying the URL from the
address bar into your newsreader app.</p>
<p>Visit <a href="https://aboutfeeds.com/">About
Feeds</a> to learn more about newsreaders.</p>
</div>
</article>
</xsl:template>
<xsl:template match="atom:entry">
<li>
<div class="atom-post-list-entry">
<a target="_blank">
<xsl:attribute name="href">
<xsl:value-of select="atom:id" />
</xsl:attribute>
<xsl:value-of select="atom:title" /></a>
<span class="post-meta"> (<xsl:value-of select="atom:updated-readable" />)</span>
<!--
Uncomment below to incorporate post excerpts into the styled preview.
Note that the excerpts are included in the *feed itself* in either
case, as defined in feed.xml.
-->
<!-- <xsl:value-of select="atom:summary" disable-output-escaping="no" /> -->
</div>
</li>
</xsl:template>
</xsl:stylesheet>