pages/webring/index.html
dozens ca665dbbf3 fixes a few comments from lucidiot
- adds `htmlUrl` to opml entry items
- removes `title` from opml entity
- removes superfluous jq call, moves query to recsel

**NOTE:** mustache apparently has a quirk where when iterating over a
list, it will interpret a 0 and a 1 as false and true unless/until there
is also a 2. at which point it will start interpreting the numbers as
numbers. this commit does NOT fix this. i just manually changed the
`false` to `0` in the generated html. this problem will fix itself once
we have at least 3 webring members.
2023-10-31 08:43:42 -06:00

74 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>webring</title>
<style type="text/css" media="screen">
body {
max-width: 70ch;
margin: 0 auto;
}
</style>
</head>
<body>
<header>
<h1>the benevolent tildepals basement heroes 43beans commonhealth of casakhstan webring</h1>
</header>
<main>
<section>
<h2>members</h2>
<ul>
<li>
<a href="https://tilde.town/~dozens">tilde.town/~dozens</a>
</li>
</ul>
</section>
<section id="about">
<h2>about</h2>
<p>
for more info about becoming a member
and adding the webring to your site
see <a href="https://tildegit.org/casa/pages/src/branch/main/webring">https://tildegit.org/casa/pages/src/branch/main/webring</a>
</p>
</section>
</main>
<footer>
<p>
<small>
this webring is built using <a href="https://git.tilde.town/dozens/webring">https://git.tilde.town/dozens/webring</a>
</small>
</p>
</footer>
</body>
</html>
<script>
const members = [
{
"id": 0,
"name": "dozens",
"url": "https://tilde.town/~dozens",
},
]
const last = members.length - 1
const query = window.location.search
const params = new URLSearchParams(query)
const name = params.get('name')
const dir = params.get('dir')
if (name && dir) {
const step = (dir === 'next') ? 1 : (dir === 'prev') ? -1 : 0
const member = members.filter(member => member.name === name)[0]
if (!(typeof member === "undefined")) {
const next = (member.id + step > last)
? 0
: (member.id + step < 0)
? last
: member.id + step
const loc = members.filter(m => m.id === next)[0]
window.location.replace(loc.url)
}
}
</script>