From 21329df36dd728dc6d514f56aab6a1170ee24c40 Mon Sep 17 00:00:00 2001 From: dozens Date: Mon, 30 Oct 2023 11:23:47 -0600 Subject: [PATCH] intitial commit --- .gitignore | 2 + README.md | 47 ++++++++++++++++ db/members.rec | 124 ++++++++++++++++++++++++++++++++++++++++ justfile | 49 ++++++++++++++++ src/example.html | 143 +++++++++++++++++++++++++++++++++++++++++++++++ src/example.opml | 16 ++++++ www/.gitkeep | 0 7 files changed, 381 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 db/members.rec create mode 100644 justfile create mode 100644 src/example.html create mode 100644 src/example.opml create mode 100644 www/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3264084 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +www/index.html +www/webring.opml diff --git a/README.md b/README.md new file mode 100644 index 0000000..d7b0a57 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# DOZENSRING + +> a webring for the dozensweb + +## ABOUT + +this project provides a webring +for members of the dozensweb + +features: + +- provides "next" and "previous" links, and a link to the index + +- links to an opml file for all sites that provide a feed + +- stores member info in a recfile + +- static content only, no server needed + +- requires no javascript of the membersite + +see it live at https://tilde.town/~dozens/webring/dozens/ + +## GETTING STARTED + +everything you need to know to get started +is in `src/example.html`. + +you will need: + +- git + +- a text editor + +- (optional) just: a task runner. + https://github.com/casey/just + +- (optional) GNU recutils: a plain text database. + https://www.gnu.org/software/recutils/ + +## CONTRIBUTING + +1. Download the code + +2. Add an entry to the recfile + +3. email a patch to dozens@tilde.team diff --git a/db/members.rec b/db/members.rec new file mode 100644 index 0000000..0590af8 --- /dev/null +++ b/db/members.rec @@ -0,0 +1,124 @@ +%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 + +id: 0 +created: Thu, 12 Oct 2023 18:51:39 -0600 +title: tilde.town +name: town +url: http://tilde.town/~dozens/ + +id: 1 +created: Thu, 12 Oct 2023 18:52:05 -0600 +title: dozens and dragons +name: dozensanddragons +url: https://dozensanddragons.neocities.org/ +feed: https://dozensanddragons.neocities.org/rss.xml + +id: 2 +created: Thu, 12 Oct 2023 18:52:45 -0600 +title: supervegan +name: supervegan +url: https://supervegan.neocities.org/ +feed: https://supervegan.neocities.org/feed.xml + +id: 3 +created: Thu, 12 Oct 2023 18:53:18 -0600 +title: Society For Putting Things On Top Of Other Things +name: society +url: https://society.neocities.org/ +feed: https://society.neocities.org/rss.xml + +id: 4 +created: Thu, 12 Oct 2023 18:53:58 -0600 +title: dream journal +name: dreams +url: https://tilde.team/~dozens/dreams/ +feed: https://tilde.team/~dozens/dreams/rss.xml + +id: 5 +created: Thu, 12 Oct 2023 18:56:55 -0600 +title: tildewhirl podcast +name: tildewhirl +url: http://tilde.town/~dozens/podcast/ +feed: http://tilde.town/~dozens/podcast/rss.xml + +id: 6 +created: Thu, 12 Oct 2023 19:01:23 -0600 +title: list blog +name: lists +url: http://tilde.town/~dozens/listblog/ +feed: http://tilde.town/~dozens/listblog/feed.xml + +id: 7 +created: Thu, 12 Oct 2023 19:01:55 -0600 +title: consume +name: consume +url: http://tilde.town/~dozens/consume/ +feed: https://tilde.town/~dozens/consume/feed.xml + +id: 8 +created: Thu, 12 Oct 2023 19:07:48 -0600 +title: piblog +name: piblog +url: http://tilde.town/~dozens/piblog/ +feed: http://tilde.town/~dozens/piblog/feed.xml + +id: 9 +created: Thu, 12 Oct 2023 19:08:44 -0600 +title: status cafe +name: statuscafe +url: https://status.cafe/users/dozens +feed: https://status.cafe/users/dozens.atom + +id: 10 +created: Thu, 12 Oct 2023 19:10:05 -0600 +title: mastodon +name: mastodon +url: https://tiny.tilde.website/@dozens +feed: https://tiny.tilde.website/@dozens.rss + +id: 11 +created: Thu, 12 Oct 2023 19:11:34 -0600 +title: linkhut +name: linkhut +url: https://ln.ht/~dozens +feed: https://ln.ht/_/feed/~dozens + +id: 12 +created: Thu, 12 Oct 2023 19:12:35 -0600 +title: peertube +name: peertube +url: https://tube.tchncs.de/a/dozens/video-channels +feed: https://tube.tchncs.de/feeds/videos.xml?accountId=47463 + +id: 13 +created: Thu, 12 Oct 2023 19:13:08 -0600 +title: basement quest +name: quest +url: http://tilde.town/~dozens/quest/ +feed: ttps://tilde.town/~dozens/quest/rss.xml + +id: 14 +created: Fri, 13 Oct 2023 19:28:08 -0600 +title: gamelog +name: gamelog +url: http://tilde.town/~dozens/gamelog/ +feed: https://tilde.town/~dozens/gamelog/feed.xml + +id: 15 +created: Fri, 13 Oct 2023 19:29:38 -0600 +title: pro toad and superb owl +name: protoad +url: https://git.tilde.town/dozens/protoadandsuperbowl/ +feed: https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/feed.xml diff --git a/justfile b/justfile new file mode 100644 index 0000000..b157b49 --- /dev/null +++ b/justfile @@ -0,0 +1,49 @@ +# 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 + +# rec2json +_json: + recsel db/members.rec \ + | rec2csv \ + | csvjson \ + | jq '. | {data: .}' + +# build html +html: + recsel db/members.rec \ + | rec2csv \ + | csvjson \ + | jq '. | {data: .}' \ + | mustache - src/example.html www/index.html + +# build opml +opml: + recsel db/members.rec \ + | rec2csv \ + | csvjson \ + | jq '. | {data: .}' \ + | jq '{ data: [ .data[] | select(.feed != null) ] }' \ + | mustache - src/example.opml www/webring.opml + +# compile html and opml +build: html opml + +# upload +up: + rsync -zaP www/ tilde:public_html/webring/dozens diff --git a/src/example.html b/src/example.html new file mode 100644 index 0000000..4819bf8 --- /dev/null +++ b/src/example.html @@ -0,0 +1,143 @@ + + + + + + webring + + + +
+

a very powerful webring

+
+
+
+

about

+

+this is a webring. +a webring is like an onion ring +except it is more abstract and intangible and you can't eat it. +but if you imagine the breading of the onion ring +as a series of websites instead of fried batter, +then you will notice that if you follow +the breadcrumbs, as it were, +by the time you've gotten to the bottom of the list, +then you've arrived back at the top! +

+
+
+

members

+ +
+
+

feeds

+

+here's a special bonus, +just for you, +our special friend. +a special little treat +for special little you. +it's an opml file of all webring members +that have a feed. +here you go! +

+
+
+

how it works

+

+this webring requires no client/member-side javascript. +it works by navigating to this page +with certain query parameters. e.g. +?name=town&dir=next. +then this page will do some javascript +and redirect the user to the next (or previous) page in the ring. +so you can make the whole thing work +with just a couple of anchor tags on your site. +

+
+
+

join

+

+to join this onion webring, +add your information to db/members.rec +at https://git.tilde.town/dozens/webring +

+
+
+

snippet

+

+once you have been added to the database, +you can include the webring html on your page however you like. +here's an example: +

+ +
+<div>
+<p>this site is a member of a very powerful webring!</p>
+<p>
+  <a href="https://tilde.town/~dozens/webring/dozens/index.html?name=yoursitename&dir=prev">previous</a> |
+  <a href="https://tilde.town/~dozens/webring/dozens/index.html">all</a> |
+  <a href="https://tilde.town/~dozens/webring/dozens/index.html?name=yoursitename&dir=next">next</a> >
+</p>
+</div>
+          
+
+

+that'd look like this: +

+
+
+

this site is a member of a very powerful webring!

+

+ < previous | + all | + next > +

+
+
+
+
+ + + + + diff --git a/src/example.opml b/src/example.opml new file mode 100644 index 0000000..7d223bf --- /dev/null +++ b/src/example.opml @@ -0,0 +1,16 @@ + + + + webring + webring + dozens + dozens@tilde.team + + + + {{#data}} + + {{/data}} + + + diff --git a/www/.gitkeep b/www/.gitkeep new file mode 100644 index 0000000..e69de29