-
Notifications
You must be signed in to change notification settings - Fork 900
/
feed.xslt.xml
153 lines (151 loc) · 7.5 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<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"/> • GTN News </title>
<link rel="icon" type="image/png">
<xsl:attribute name="href">
<xsl:value-of select="atom:feed/atom:logo"/>
</xsl:attribute>
</link>
<link href="https://fonts.googleapis.com/css2?family=Recursive:slnt,wght,CASL,CRSV,[email protected],300..800,0..1,0..1,1&display=swap" rel="stylesheet"/>
<style type="text/css">
:root {--step--2: clamp(0.7813rem, 0.7747rem + 0.0326vi, 0.8rem);--step--1: clamp(0.9375rem, 0.9158rem + 0.1087vi, 1rem);--step-0: clamp(1.125rem, 1.0815rem + 0.2174vi, 1.25rem);--step-1: clamp(1.35rem, 1.2761rem + 0.3696vi, 1.5625rem);--step-2: clamp(1.62rem, 1.5041rem + 0.5793vi, 1.9531rem);--step-3: clamp(1.944rem, 1.771rem + 0.8651vi, 2.4414rem);--step-4: clamp(2.3328rem, 2.0827rem + 1.2504vi, 3.0518rem);--step-5: clamp(2.7994rem, 2.4462rem + 1.7658vi, 3.8147rem);--brand: #782760;--secondary: #b970a3;--brand-contrast: white;}
body {max-width:768px; margin: 0 auto; font-family: 'Recursive', serif; font-variation-settings: "CASL" 0, "CRSV" 1; font-size:var(--step--1); font-weight: 350;}
h1{margin:0;font-size:var(--step-3);line-height:1.125em; weight: 900; text-transform: capitalize;font-variation-settings: "wght" 900, "CRSV" 0.5, "CASL" 0;}
h2{margin:0;font-size:var(--step-2); font-weight: 500; font-variation-settings: "CRSV" 0.5, "CASL" 1;}
hgroup{margin-bottom:2rem;}
h3{font-size:var(--step-1);}
h4{font-size:var(--step-0);}
h5{font-size:var(--step--1);}
small{font-size:var(--step--2);}
.alert{background:#fff5b1;padding:4px 12px;margin:0 -12px}
a{text-decoration:none}
div.entry h3{margin-bottom:0}
div.entry p{margin:4px 0}
.authors{font-style: italic}
body { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: 'header' 'main' 'footer';}
header {grid-area: header; padding: 0.5em; border-bottom: 2px solid var(--secondary); display: flex; flex-direction: column;}
header img {margin-right: 0.5em}
main { grid-area: main; padding: 15px 5px 10px 5px;}
footer { grid-area: footer; padding: 0.5em; border-top: 2px solid var(--secondary); }
div.entry a { text-decoration: underline; }
div.entry a:hover{ text-decoration: underline; font-weight: 700;}
footer a { text-decoration: underline; }
footer a:hover{ font-weight:700; }
</style>
</head>
<body>
<header>
<div class="alert">
<p><strong>This is a web feed</strong>, also known as an RSS feed. <strong>Subscribe</strong> by copying the URL from the address bar into your newsreader app.</p>
</div>
<hgroup>
<h1>
<a class="head_link" target="_blank">
<xsl:attribute name="href">
<xsl:value-of select="concat(atom:feed/atom:link[@rel='alternate']/@href, '?utm_source=embed&utm_medium=rss-widget&utm_campaign=rss')"/>
</xsl:attribute>
<xsl:value-of select="concat(atom:feed/atom:title, ' (Feed Preview)')"/>
</a>
</h1>
<p><xsl:value-of select="atom:feed/atom:subtitle"/></p>
</hgroup>
<h2>What is an RSS feed?</h2>
<p>An RSS feed is a data format that contains the latest content from a website, blog, or podcast. You can use feeds to <strong>subscribe</strong> to websites and get the <strong>latest content in one place</strong>.</p>
<ul>
<li><strong>Feeds put you in control.</strong> Unlike social media apps, there is no algorithm deciding what you see or read. You always get the latest content from the creators you care about.</li>
<li><strong>Feed are private by design.</strong> No one owns web feeds, so no one is harvesting your personal information and profiting by selling it to advertisers.</li>
<li><strong>Feeds are spam-proof.</strong> Had enough? Easy, just unsubscribe from the feed.</li>
</ul>
<p>All you need to do to get started is to add the URL (web address) for this feed to a special app called a newsreader. Visit <a href="https://aboutfeeds.com/">About Feeds</a> to get started with newsreaders and subscribing. It’s free. </p>
</header>
<main>
<h2>Recent Items</h2>
<xsl:apply-templates select="atom:feed/atom:entry" />
</main>
<footer>
<a target="_blank" href="https://training.galaxyproject.org/training-material/news/2024/06/04/gtn-standards-rss.html?utm_source=embed&utm_medium=rss-widget&utm_campaign=rss">GTN RSS Feed</a>
•
<a target="_blank" href="https://spdx.org/licenses/CC-BY-4.0">CC-BY 4.0</a>
•
<a target="_blank" href="https://training.galaxyproject.org/training-material/faqs/gtn/fair_training.html?utm_source=embed&utm_medium=rss-widget&utm_campaign=rss">FAIR</a>
•
<a target="_blank">
<xsl:attribute name="href">
<xsl:value-of select="concat(atom:feed/atom:link[@rel='self']/@href, '?utm_source=embed&utm_medium=rss-widget&utm_campaign=rss')"/>
</xsl:attribute>
🔗
</a>
</footer>
</body>
</html>
</xsl:template>
<xsl:template match="atom:entry">
<div class="entry">
<xsl:attribute name="data-has-link">
<xsl:choose>
<xsl:when test="atom:link/@href">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<h3>
<xsl:choose>
<xsl:when test="atom:link/@href">
<a target="_blank">
<xsl:attribute name="href">
<xsl:value-of select="concat(atom:link/@href, '?utm_source=embed&utm_medium=rss-widget&utm_campaign=rss')"/>
</xsl:attribute>
<xsl:value-of select="atom:title"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="atom:title"/>
</xsl:otherwise>
</xsl:choose>
</h3>
<!-- If author isn't "GTN" -->
<xsl:if test="atom:author/atom:name != 'GTN'">
<p class="authors">
<i>By: </i><xsl:for-each select="atom:author">
<a href="{atom:uri}">
<xsl:value-of select="atom:name" />
</a>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</p>
</xsl:if>
<!-- if summary -->
<p class="summary">
<xsl:choose>
<xsl:when test="atom:summary">
<xsl:value-of select="atom:summary" disable-output-escaping="yes" />
</xsl:when>
<xsl:when test="atom:content">
<xsl:copy-of select="atom:content" />
</xsl:when>
</xsl:choose>
</p>
<small>
Published: <xsl:value-of select="atom:updated" /> <br/>
Tags:
<xsl:for-each select="atom:category">
<xsl:value-of select="@term" />
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</small>
</div>
</xsl:template>
</xsl:stylesheet>