112 lines
3.3 KiB
HTML
112 lines
3.3 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 commonheath of casakhstan webring</h1>
|
|
</header>
|
|
<main>
|
|
<section>
|
|
<h2>members</h2>
|
|
<ul>
|
|
{{#data}}
|
|
<li>
|
|
<a href="{{{url}}}">{{{title}}}</a>
|
|
</li>
|
|
{{/data}}
|
|
</ul>
|
|
</section>
|
|
<section id="join">
|
|
<h2>joining</h2>
|
|
<p>
|
|
add your info to <code>members.rec</code>:
|
|
</p>
|
|
<p>
|
|
<a href="https://tildegit.org/casa/pages/src/branch/main/webring/db/members.rec">https://tildegit.org/casa/pages/src/branch/main/webring/db/members.rec</a>
|
|
</p>
|
|
</section>
|
|
<section id="snippet">
|
|
<h2>snippet</h2>
|
|
<details>
|
|
<summary>code snippet to add to member site</summary>
|
|
<p>
|
|
all you have to do
|
|
(after you've been added to the db)
|
|
is add a few anchor tags to your site.
|
|
you can do something like this,
|
|
replacing "yoursitename"
|
|
with the value of "name"
|
|
you provide in <code>members.rec</code>
|
|
</p>
|
|
<code><pre>
|
|
<div>
|
|
<p>this site is a member of a very powerful webring!</p>
|
|
<p>
|
|
< <a href="https://friends.m455.casa/webring/index.html?name=yoursitename&dir=prev">previous</a> |
|
|
<a href="https://friends.m455.casa/webring/index.html">all</a> |
|
|
<a href="https://friends.m455.casa/webring/index.html?name=yoursitename&dir=next">next</a> >
|
|
</p>
|
|
</div>
|
|
</pre></code>
|
|
<p>
|
|
that would end up looking something like this:
|
|
</p>
|
|
<p>
|
|
<blockquote>
|
|
<div>
|
|
<p>this site is a member of a very powerful webring!</p>
|
|
<p>
|
|
< <a href="https://friends.m455.casa/webring/index.html?name=yoursitename&dir=prev">previous</a> |
|
|
<a href="https://friends.m455.casa/webring/index.html">all</a> |
|
|
<a href="https://friends.m455.casa/webring/index.html?name=yoursitename&dir=next">next</a> >
|
|
</p>
|
|
</div>
|
|
</blockquote>
|
|
</p>
|
|
</details>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
<script>
|
|
const members = [
|
|
{{#data}}
|
|
{
|
|
"id": {{{id}}},
|
|
"name": "{{{name}}}",
|
|
"url": "{{{url}}}",
|
|
},
|
|
{{/data}}
|
|
]
|
|
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>
|