Compare commits
6 Commits
main
...
feature/we
Author | SHA1 | Date | |
---|---|---|---|
ca665dbbf3 | |||
c735cde7bc | |||
ffc1c77ad0 | |||
c2bd07cbe1 | |||
d7c5108c5b | |||
7f5c57d7de |
32
webring/README.md
Normal file
32
webring/README.md
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# webring
|
||||||
|
|
||||||
|
the benevolent tildepals basement heroes 43beans commonhealth of casakhstan webring
|
||||||
|
|
||||||
|
## joining
|
||||||
|
|
||||||
|
add your info to `db/members.rec`
|
||||||
|
|
||||||
|
## snippet
|
||||||
|
|
||||||
|
a code snippet to add to member site
|
||||||
|
|
||||||
|
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 the following,
|
||||||
|
replacing "yoursitename" with the value of "name" you provide in
|
||||||
|
members.rec
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
that would end up looking something like this:
|
||||||
|
|
||||||
|
this site is a member of a very powerful webring!
|
||||||
|
|
||||||
|
< previous | all | next >
|
||||||
|
|
30
webring/db/members.rec
Normal file
30
webring/db/members.rec
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
%rec: member
|
||||||
|
%doc: a member of the webring
|
||||||
|
%key: id
|
||||||
|
%unique: id name url feed
|
||||||
|
%auto: id created
|
||||||
|
%type: id int
|
||||||
|
%type: created date
|
||||||
|
%type: title,url,feed line
|
||||||
|
%typedef: Name_t regexp /[a-z]{3,13}/
|
||||||
|
%type: name Name_t
|
||||||
|
%allowed: id created title name url feed
|
||||||
|
%mandatory: id title name url
|
||||||
|
%sort: id
|
||||||
|
|
||||||
|
|
||||||
|
# FIELDS AND VALUES
|
||||||
|
# id: an incrementing integer
|
||||||
|
# created: timestamp
|
||||||
|
# name: a short slug to be used in the query params.
|
||||||
|
# 3 - 13 letters, lowercase, no spaces
|
||||||
|
# title: the title of your site. can be different from
|
||||||
|
# name. can have spaces, capital letters, etc
|
||||||
|
# url: link to the page where the webring code will appear
|
||||||
|
# feed: optional. a link to a rss/atom feed for your site
|
||||||
|
|
||||||
|
id: 0
|
||||||
|
created: Mon, 30 Oct 2023 13:38:40 -0600
|
||||||
|
name: dozens
|
||||||
|
title: tilde.town/~dozens
|
||||||
|
url: https://tilde.town/~dozens
|
73
webring/index.html
Normal file
73
webring/index.html
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
<!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>
|
37
webring/justfile
Normal file
37
webring/justfile
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# list all recipes
|
||||||
|
default:
|
||||||
|
just --list --unsorted
|
||||||
|
|
||||||
|
# add a new webring member
|
||||||
|
new:
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
read -p "name (lowercase, 3-13 characters): " name
|
||||||
|
read -p "title: " title
|
||||||
|
read -p "url: " url
|
||||||
|
read -p "feed: " feed
|
||||||
|
recins --verbose -t member \
|
||||||
|
-f "name" -v "$name" \
|
||||||
|
-f "title" -v "$title" \
|
||||||
|
-f "url" -v "$url" \
|
||||||
|
-f "feed" -v "$feed" \
|
||||||
|
db/members.rec
|
||||||
|
alias add := new
|
||||||
|
|
||||||
|
# build html
|
||||||
|
html:
|
||||||
|
recsel db/members.rec \
|
||||||
|
| rec2csv \
|
||||||
|
| csvjson \
|
||||||
|
| jq '. | {data: .}' \
|
||||||
|
| mustache - src/example.html index.html
|
||||||
|
|
||||||
|
# build opml
|
||||||
|
opml:
|
||||||
|
recsel db/members.rec -e 'feed != ""' \
|
||||||
|
| rec2csv \
|
||||||
|
| csvjson \
|
||||||
|
| jq '. | {data: .}' \
|
||||||
|
| mustache - src/example.opml webring.opml
|
||||||
|
|
||||||
|
# compile html and opml
|
||||||
|
build: html opml
|
77
webring/src/example.html
Normal file
77
webring/src/example.html
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
<!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>
|
||||||
|
{{#data}}
|
||||||
|
<li>
|
||||||
|
<a href="{{{url}}}">{{{title}}}</a>
|
||||||
|
</li>
|
||||||
|
{{/data}}
|
||||||
|
</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 = [
|
||||||
|
{{#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>
|
15
webring/src/example.opml
Normal file
15
webring/src/example.opml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<opml version="2.0">
|
||||||
|
<head>
|
||||||
|
<text>tildepals webring</text>
|
||||||
|
<ownerName>dozens</ownerName>
|
||||||
|
<ownerEmail>dozens@tilde.team</ownerEmail>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<outline text="tildepals webring" title="tildepals webring">
|
||||||
|
{{#data}}
|
||||||
|
<outline text="{{{name}}}" title="{{{title}}}" type="rss" xmlUrl="{{{feed}}}" htmlUrl="{{{url}}}" />
|
||||||
|
{{/data}}
|
||||||
|
</outline>
|
||||||
|
</body>
|
||||||
|
</opml>
|
13
webring/webring.opml
Normal file
13
webring/webring.opml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<opml version="2.0">
|
||||||
|
<head>
|
||||||
|
<title>tildepals webring</title>
|
||||||
|
<text>tildepals webring</text>
|
||||||
|
<ownerName>dozens</ownerName>
|
||||||
|
<ownerEmail>dozens@tilde.team</ownerEmail>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<outline text="tildepals webring" title="tildepals webring">
|
||||||
|
</outline>
|
||||||
|
</body>
|
||||||
|
</opml>
|
Loading…
Reference in New Issue
Block a user