-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvoices.xsl
More file actions
115 lines (108 loc) · 4.84 KB
/
Copy pathvoices.xsl
File metadata and controls
115 lines (108 loc) · 4.84 KB
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
<?xml version="1.0" encoding="utf-8"?>
<!--
This is an XSL stylesheet that takes the OPML export from Feedly and converts it to a sorted list of websites.
The goal is to:
- Expose interesting voices on the web and encourage discovery
- Keep it easy to maintain (ingest OPML with minimal modification)
-->
<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" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/opml">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Voices - Nathan Long</title>
<meta charset="utf-8"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="/css/styles.css"/>
<style type="text/css">
</style>
</head>
<body>
<!-- this is to preserve color settings from elsewhere on my site, remove if you're pulling this for your own -->
<script>
// Prevent FART (look it up) by blocking render for a tiny bit...
// First check for local settings, then check media queries, then apply fallback
function getColor() {
const colorPref = window.localStorage.getItem('color-mode');
if (typeof colorPref === 'string') {
return colorPref;
}
const mql = window.matchMedia('(prefers-color-scheme: dark)');
if (typeof mql.matches === 'boolean') {
return mql.matches ? 'dark' : 'light';
}
return 'light';
}
function getMotion() {
const motionPref = window.localStorage.getItem('motion-mode');
if (typeof motionPref === 'string') {
return motionPref;
}
const mql = window.matchMedia('(prefers-reduced-motion: no-preference)');
if (typeof mql.matches === 'boolean') {
return mql.matches ? 'no-preference' : 'reduced'
}
return 'no-preference';
}
function getParty() {
const partyPref = window.localStorage.getItem('party-mode')
if (typeof partyPref === 'string') {
return partyPref;
}
return 'no-party';
}
const colorMode = getColor();
const motionMode = getMotion();
const partyMode = getParty();
const root = document.documentElement;
root.classList.add(colorMode, partyMode, motionMode);
root.style.setProperty('--play-state', motionMode === "reduced" ? "paused" : "running")
root.style.setProperty('--transition-toggle', motionMode === "reduced" ? "0" : "1")
</script>
<main class="content text-content flow mb-4">
<a class="absolute top-1/2 left-1 text-small" href="/">← Return to Site</a>
<section class="mt-content text-center">
<h1 class="mb-1/4">Web Voices</h1>
<p>A Collection of Websites and Feeds from the Web Industry</p>
<p class="text-small">Download the <a href="/voices/feed.opml">OPML file</a> to import into your feed reader of choice.</p>
<p class="text-small color-reduced">Updated on <xsl:value-of select="substring(head/dateCreated, 6, 11)"/></p>
</section>
<xsl:for-each select="body/outline">
<xsl:sort select="@text" order="ascending" />
<fieldset class="feature border-1 border-divider leading-md">
<legend class="p-1/2 font-bold font-thin heading-200"><xsl:value-of select="@text"/></legend>
<ul class="p-1 pl-2 two-columns-md">
<xsl:for-each select="outline">
<xsl:sort select="@text" order="ascending" />
<li class="mb-1/2 flex-col break-inside-avoid">
<strong>
<xsl:value-of select="@text"/>
</strong>
<div>
<xsl:choose>
<xsl:when test="@htmlUrl">
<a href="{@htmlUrl}">Website</a>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="@htmlUrl and @xmlUrl">
<span> - </span>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="@xmlUrl">
<a href="{@xmlUrl}">Feed</a>
</xsl:when>
</xsl:choose>
</div>
</li>
</xsl:for-each>
</ul>
</fieldset>
</xsl:for-each>
</main>
</body>
</html>
</xsl:template>
</xsl:stylesheet>