shithub: web

Download patch

ref: ded16ab8b26fb95e6584f80094961cb1492de841
parent: 0310076c3496e2897f23e637607cc01211a3c8af
author: sirjofri <sirjofri@sirjofri.de>
date: Mon Jan 18 06:30:32 EST 2021

adds page generator

mk will create a public directory. It's planned to have an overlay root/ directory (for static resources like images) that's bound over public/. mkdir -p root/img/

diff: cannot open b/frag//null: file does not exist: 'b/frag//null'
--- /dev/null
+++ b/README
@@ -1,0 +1,21 @@
+9P.ZONE WEB PAGE
+
+This repository holds the web page for 9p.zone, available at:
+
+	http://9p.zone/
+
+Ideally via https.
+
+
+USAGE
+
+Build the pages:
+
+	mk  # or: mk -a
+
+Put in /lib/namespace.httpd:
+
+	bind /path/to/web/public /usr/web
+	bind -a /path/to/web/root /usr/web
+
+Make sure the directories are public readable!
--- /dev/null
+++ b/frag/footer.inc
@@ -1,0 +1,10 @@
+</main>
+<footer>
+<hr>
+<a href="/">start</a> •
+<a href="/legal/">legal</a> •
+© Copyright 2021 9p.zone
+</footer>
+<br>
+</body>
+</html>
--- /dev/null
+++ b/frag/header.inc
@@ -1,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="description" content="%DESC%">
+<title>9p.zone — %TITLE%</title>
+<style type="text/css">
+body {
+	font-family: sans-serif;
+	max-width: 960px;
+	margin: auto;
+	padding: 5px;
+}
+</style>
+</head>
+<body>
+<header>
+<h1>%PAGETITLE%</h1>
+<b>9p.zone</b><br>
+<nav>
+<a href="/">start</a> •
+<a href="/man/">man</a> •
+<a href="/legal/">legal</a>
+</nav>
+</header>
+<main>
--- /dev/null
+++ b/index.ht
@@ -1,0 +1,36 @@
+<section>
+<header>
+<h2>9p.zone is a public 9p registry and more.</h2>
+</header>
+<p>We not only provide a public service registry, also some public services are done under this domain.</p>
+<p>This international project is done by multiple people distributed all over the world, united by our common interest in the 9p protocol as well as other concepts and software in the Plan 9 family.</p>
+<p>All our services are publicly available for free. Although we would love to have infinite resources for free, without money nothing really works. Servers cost money, hosting a domain costs money.</p>
+<p><strong>More info coming soon!</strong></p>
+</section>
+
+<section>
+<header>
+<h2>Participate</h2>
+</header>
+<p>You can use our service registry for free.</p>
+<p><strong>More info coming soon!</strong></p>
+</section>
+
+<section>
+<header>
+<h2>Our Services</h2>
+</header>
+<p>TBD.</p>
+</section>
+
+<section>
+<header>
+<h2>Support</h2>
+</header>
+<p>It is possible to support us with money:</p>
+<p><a href="https://liberapay.com/9p.zone/donate">
+<img src="https://img.shields.io/liberapay/patrons/9p.zone.png?logo=liberapay">
+<img src="https://img.shields.io/liberapay/receives/9p.zone.png?logo=liberapay">
+<img src="https://img.shields.io/liberapay/goal/9p.zone.png?logo=liberapay">
+</a></p>
+</section>
--- /dev/null
+++ b/index.sed
@@ -1,0 +1,3 @@
+s/%TITLE%/Start page/g
+s/%DESC%/public 9p registry/g
+s/%PAGETITLE%/A Public Registry for 9p Services/g
--- /dev/null
+++ b/man.ht
@@ -1,0 +1,5 @@
+<section>
+<header>
+<h2>How to Use our Services</h2>
+</header>
+</section>
--- /dev/null
+++ b/man.sed
@@ -1,0 +1,3 @@
+s/%TITLE%/Manual/g
+s/%DESC%/How to Use our Services/g
+s/%PAGETITLE%/How to Use our Services/g
--- /dev/null
+++ b/mkfile
@@ -1,0 +1,20 @@
+pages=`{ls *.ht | grep -v index.ht | sed 's:\.ht$:/index.html:'}
+
+all:VQ: ${pages:%=public/%} public/index.html
+
+public/%/index.html:DQ: %.ht %.sed
+
+public/index.html:DQ: index.ht index.sed
+
+public/%.html:DQ:
+	echo building $target
+	d=`{basename -d $stem}
+	~ $d '.' && d=index
+	t=$target
+	mkdir -p `{basename -d $t}
+	>$target {
+		cat frag/header.inc $d.ht frag/footer.inc | sed -f $d.sed
+	}
+
+clean:V:
+	rm -rf public/*