add webring

a couple other changes too

- minify gruvbox with cleancss tool
- change homepage links to use ~ instead of -
- tidy up tilde.json explorer
This commit is contained in:
Ben Harris 2021-01-09 23:34:06 -05:00
parent 6ba55d31ea
commit 404e1cd1e2
13 changed files with 96 additions and 16 deletions

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>not found</title>
<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.css">
<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">

View File

@ -6,7 +6,7 @@ printf "\n"
printf "<html>\n"
printf "<head>\n"
printf "<title>Bash CGI script</title>\n"
printf '<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.css">\n'
printf '<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.min.css">\n'
printf '<meta name="viewport" content="width=device-width, initial-scale=1.0" />\n'
printf "</head>"

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>cgi-bin</title>
<link rel="stylesheet" href="../gruvbox/gruvbox.css">
<link rel="stylesheet" href="../gruvbox/gruvbox.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>some fonts</title>
<link rel="stylesheet" href="../gruvbox/gruvbox.css">
<link rel="stylesheet" href="../gruvbox/gruvbox.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">

1
gruvbox/gruvbox.min.css vendored Normal file
View File

@ -0,0 +1 @@
main{-webkit-font-feature-settings:"liga" on,"calt" on;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-family:'JetBrains Mono',monospace;max-width:38rem;padding:2rem;margin:auto}@media only screen and (max-device-width:736px){main{padding:0}}::selection{background:#d3869b}body{background:#282828;color:#ebdbb2}pre{background-color:#3c3836;padding:1em;border:0}a,a:active,a:visited{color:#b16286;background-color:#1d2021}h1,h2,h3,h4,h5{margin-bottom:.1rem}blockquote{border-left:1px solid #bdae93;margin:.5em 10px;padding:.5em 10px}footer{align:center}

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>gruvbux</title>
<link rel="stylesheet" href="gruvbox.css">
<link rel="stylesheet" href="gruvbox.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -17,10 +16,10 @@
<title>ben~tilde.team</title>
<link rel="icon" type="image/png" sizes="192x192" href="https://tilde.team/apple-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://tilde.team/favicon-32x32.png">
<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.css">
<link rel="stylesheet" href="https://tilde.team/css/fork-awesome.css">
<style><?php include "gruvbox/gruvbox.min.css"; ?></style>
<link rel="stylesheet" href="https://tilde.team/css/fork-awesome.min.css">
</head>
<body>
@ -84,10 +83,23 @@
<hr>
<h3>page hits as of jan 2020</h3>
<script type="text/javascript" src="counter/gcount.php?page=index"></script>
<hr>
<!-- Begin Tilde.Team Ring Fragment-->
<div id="newring">
<center>
[<a href="https://tilde.team/~ben/ring/?action=prev&me=ben">previous page</a>]
[<a href="https://tilde.team/~ben/ring/?action=random&me=ben">random page</a>]
[<a href="https://tilde.team/~ben/ring/?action=next&me=ben">next page</a>]
<br>
<a href="https://tilde.team/~ben/ring/">how to join this webring</a>
</center>
</div>
<hr>
<footer>
<a href="https://tildegit.org/ben/tilde">page source</a>
</footer>
@ -111,8 +123,5 @@
xmlHttp.send(null);
}
</script>
</body>
</html>

View File

@ -52,7 +52,7 @@ $links = [
?>
<?php foreach ($links as $name => $link): ?>
-&gt; <a <?=$link["extra_attrs"] ?? ""?> href="<?=$link["href"]?>">
~&gt; <a <?=$link["extra_attrs"] ?? ""?> href="<?=$link["href"]?>">
<i class="<?=faclass($link["icon"])?>"></i> <?=$name?>
</a>
<br>

View File

@ -80,7 +80,7 @@ $links = [
?>
<?php foreach ($links as $name => $link): ?>
-&gt; <a <?=$link["extra_attrs"] ?? ""?> href="<?=$link["href"]?>">
~&gt; <a <?=$link["extra_attrs"] ?? ""?> href="<?=$link["href"]?>">
<i class="<?=faclass($link["icon"])?>"></i> <?=$name?>
</a>
<br>

69
ring/index.php Normal file
View File

@ -0,0 +1,69 @@
<?php
$action = $_GET["action"] ?? "index";
if ($action !== "index") {
$users = [];
foreach (glob("/home/*/.ring") as $path)
$users[] = basename(dirname($path));
$me = $_GET["me"] ?? "";
$i = array_search($me, $users) ?? 0;
switch ($action) {
case "random":
$notme = array_diff($users, [$me]);
$user = $notme[array_rand($notme)];
break;
case "next":
$user = $users[$i + 1] ?? $users[0];
break;
case "prev":
$user = $users[$i - 1] ?? $users[count($users) - 1];
break;
default:
die("invalid action");
}
header("Location: https://tilde.team/~$user/");
die();
}
else {
$snippet = '<!-- Begin Tilde.Team Ring Fragment-->
<div id="newring">
<center>
[<a href="https://tilde.team/~ben/ring/?action=prev&me=USERNAME">previous</a>]
[<a href="https://tilde.team/~ben/ring/?action=random&me=USERNAME">random</a>]
[<a href="https://tilde.team/~ben/ring/?action=next&me=USERNAME">next</a>]
<br>
<a href="https://tilde.team/~ben/ring/">how to join this webring</a>
</center>
</div>';
?>
<!DOCTYPE html>
<html>
<head>
<title>webring - how to join</title>
<link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">
<main>
<h1>how to join the webring</h1>
<p>This webring can be joined by any user on tilde.team.</p>
<p>First, add the following code to your page, replacing USERNAME by your username (no ~):</p>
<pre><?=htmlspecialchars($snippet)?></pre>
<p>You may edit the code however you want. It should work as long as the URLs are kept in place and have your user in them.</p>
<p>Then create a .ring file in your ~ to be added in the webring:</p>
<pre>$ touch ~/.ring</pre>
<p>see webring source <a href="index.php.txt">here</a></p>
<p>it will probably work if you copy it to your <code>~/public_html</code></p>
</main>
</body>
</html>
<?php }

1
ring/index.php.txt Symbolic link
View File

@ -0,0 +1 @@
index.php

View File

@ -2,7 +2,7 @@
title: suckmore
include-before: '<main>'
include-after: '</main>'
css: '../gruvbox/gruvbox.css'
css: '../gruvbox/gruvbox.min.css'
---
suckless.org is full of nazis, even though they claim to be "apolitical"

View File

@ -41,7 +41,7 @@ foreach ($tildes["members"] as $member) {
<p>url: <a href="<?=$json["url"]?>"><?=$json["url"]?></a></p>
<p>signup url: <a href="<?=$json["signup_url"]?>"><?=$json["signup_url"]?></a></p>
<p>user count: <?=$json["user_count"]?></p>
<p>accepting signups?: <?=$json["want_users"]?></p>
<p>accepting signups?: <?=$json["want_users"] ? "yes" : "no" ?></p>
<p>admin email address: <a href="mailto:<?=$json["admin_email"]?>"><?=$json["admin_email"]?></a></p>
<p>description: <?=$json["description"]?></p>