hlfw.ca

hlfw

Download patch

ref: feeb1987608bfc47465d226b78151f2056289429
parent: 9398a533f92f66b9d9c68d674584cea57cc7110c
author: halfwit <halfwit@hlfw.ca>
date: Thu Aug 22 15:28:31 PDT 2024

Add in posts, fix up linking

--- a/common.rc
+++ b/common.rc
@@ -55,7 +55,7 @@
 	shorthash=`{echo $phash | awk '{print substr($0, 0, 8)}'}
 	if (test -f $gitfs/object/$phash/committer) committer=`"{htcat $gitfs/object/$phash/committer}
 	echo '	<div id="commit">
-		<a href=/'$puser/$prepo/$phash'/commit.html>'$shorthash'</a>
+		<a href=/git/'$puser/$prepo/$phash'/commit.html>'$shorthash'</a>
 		 – '$author' authored'
 	if (! ~ $#committer 0 && ! ~ $committer $author) echo ' and '^$committer^' committed'
 	echo ' on '$"date'
@@ -78,7 +78,7 @@
 		echo '<br/>'
 	}
 	if(! ~ $#commithash 0)
-		echo '<a href="/'$puser/$prepo/$commithash(1)^'/log.html">Next</a>'
+		echo '<a href="/git/'$puser/$prepo/$commithash(1)^'/log.html">Next</a>'
 	cd $d
 }
 
@@ -122,6 +122,13 @@
 					color: #eee;
 				}
 			}
+			img {
+				display: block;
+				margin-left: auto;
+				margin-right: auto;
+				width: 95%;
+				max-width: 1024px;
+			}
 			h1{
 				font-size: 1.5em;
 				color: #4c4c99;
@@ -135,10 +142,21 @@
 				color: #4c4c99;
 			}
 
-			a{
-				padding: 1rem;
+			header{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				gap: 1rem;
 			}
+			header nav{
+				display: flex;
+			}
 
+			header nav a{
+				all: unset;
+				padding: 15px 5px;	
+			}
+
 			#code{
 				background: #ffffea;
 				border: 1px solid #99994c;
@@ -188,7 +206,15 @@
 		<title>'$title': '$"prepo'</title>
 	</head>
 	<body>
-	'
+		<header>
+			<h1>hlfw.ca</h1>
+			<nav>
+				<a href="/">home</a>
+				<a href="/git/index.html">code</a>
+				<a href="/blog/index.html">blog</a>
+			<nav>
+		</header>
+'
 }
 
 fn user_prelude {
@@ -197,15 +223,14 @@
 	phash=$3
 
 	prelude $puser $prepo
-	echo '	<h1><a href="/">'$title'</a>: 
-		<a href="/'$puser/$prepo'/HEAD/info.html">'$prepo'</a></h1>
+	echo '<h2><a href="/git/'$puser/$prepo'/HEAD/info.html">'$prepo'</a></h2>
 		<div id="linkbar">
-		<a href="/'$puser/$prepo'/HEAD/info.html">Info</a>
+		<a href="/git/'$puser/$prepo'/HEAD/info.html">Info</a>
 		&nbsp;•&nbsp;
-		<a href="/'$puser/$prepo/$phash'/files.html">Files</a>
+		<a href="/git/'$puser/$prepo/$phash'/files.html">Files</a>
 		&nbsp;•&nbsp;
-		<a href="/'$puser/$prepo/$phash'/log.html">Log</a>
+		<a href="/git/'$puser/$prepo/$phash'/log.html">Log</a>
 		&nbsp;•&nbsp;
-		<a href="/'$puser/$prepo/$phash'/branches.html">Branches</a>
+		<a href="/git/'$puser/$prepo/$phash'/branches.html">Branches</a>
 		</div>'
 }
--- a/config.rc
+++ b/config.rc
@@ -4,7 +4,7 @@
 repo=site/hlfw
 
 intro='
-	<h1>Code</h1>
+	<h1>hlfw.ca</h1>
 
-	<h2>Repositories</h2>
+	<h2>Code</h2>
 '
--- a/gitrules
+++ b/gitrules
@@ -1,4 +1,5 @@
-/git/index.html					/bin/hlfw/list		/usr/git
+/git/index.html					/bin/hlfw/gitlist	/usr/git
+/blog/index.html				/bin/hlfw/bloglist	/usr/git/site/hlfw/blog
 /git/([^'/]+)/usr.html				/bin/hlfw/usr		/usr/git '\1'
 (/.well-known/acme-challenge/([^'/]+))		/bin/hlfw/well-known	/usr/web/\1
 /git/([^'/]+)/([^'/]+)/([^'/]+)/info.html	/bin/hlfw/info		/usr/git '\1' '\2' '\3'
@@ -11,5 +12,4 @@
 /git/([^'/]+)/([^'/]+)/([^'/]+)/commit.html	/bin/hlfw/show		/usr/git '\1' '\2' '\3'
 /git/([^'/]+)/([^'/]+)/([^'/]+)/_patch		/bin/hlfw/patch		/usr/git '\1' '\2' '\3'
 /git/([^'/]+)/([^'/]+)/([^'/]+)/feed.rss	/bin/hlfw/feed		/usr/git '\1' '\2' '\3'
-/git/([^'/]+)/([^'/]+)				/bin/hlfw/clone 	/usr/git '\1' '\2'
 ([^']+).html					/bin/hlfw/md2html	/usr/git '\1'
--- a/hostrules
+++ b/hostrules
@@ -2,6 +2,6 @@
 blog.hlfw.ca	/usr/web/blog
 img.hlfw.ca	/usr/web/img
 list.hlfw.ca	/usr/web/list
-hlfw.ca		/usr/web/main
-78.141.222.139  /usr/web/main
-2a08:f480:1400:2fbb:5400:05ff:fe10:cd27	/usr/web/main
+hlfw.ca		/usr/web
+78.141.222.139  /usr/web
+2a08:f480:1400:2fbb:5400:05ff:fe10:cd27	/usr/web
--- a/index.md
+++ b/index.md
@@ -1,14 +1,17 @@
+
+## About
+
 I'm halfwit. I'm a dad, first and foremost, but also I'm a neurodivergent, celiac, lgbtq+ ally (with a penchant for over-explaining. The following page is a treatise to just that).  I am fascinated with emerging technology, both for the societal implications, and my curiosity. I strive to learn what I am able to in any fundamental field, leveraging my growing base of knowledge to create unique solutions to hard problems.
 
 I am currently working as a full-stack developer, specializing in Laravel/NodeJS, but I don't limit myself to any given technology.
 
-# Other Things?
+## Other Things?
 
 My main side project has been [Altid](https://github.com/altid). I wanted to make a software solution that took commonly used applications, and made them highly accessible, highly customizable, and access to them feel ubiquitous. After many iterations, and many great ideas from friends, I was able to land on a design that really enabled all of those fronts. My current work involves writing [client applications](https://github.com/altid/client) to really showcase what this system can enable.
 
 My side-side project has been largely integrating the networked operating system, [plan9](https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs) into my computing life! I moved from Linux, to FreeBSD/macOS, and now I'm working to use 9front as my daily driver. Other aspects are data solutions, such as setting up a NAS and a virtualization stack to run most things on (blogs coming soon!). The goal is to have the feel of a thin client that can access my 'world', my preferred desktop environment, programs, and files, without heavy synchronization, cloud hosting, or X-forwarding/VNC style solutions, that tend to not work well on devices outside of personal computers.
 
-# Future Other Things?
+## Future Other Things?
 
 If you're interested in any of the following, or if you're already on you're way with your own efforts into any of these arenas, please get in touch!
 
--- a/info
+++ b/info
@@ -33,7 +33,7 @@
 	for(b in $branches){
 		branch=`{basename `{basename -d $b}}
 		if(test -f $gitfs/branch/heads/$branch/hash){
-			echo -n ' <a href="'/$gituser/$repo/$branch/info.html'">'$branch'</a>'
+			echo -n ' <a href="'/git/$gituser/$repo/$branch/info.html'">'$branch'</a>'
 		}
 	}
 	echo ''
@@ -41,8 +41,8 @@
 
 echo '	<h3>Clone</h3>
 	<div>
-	<b>clone:</b> git://'$host/$gituser/$repo' gits://'$host/$gituser/$repo'<br>
-	<b>push:</b> hjgit://'$host/$gituser/$repo'<br>'
+	<b>clone:</b> git://'$host/git/$gituser/$repo' gits://'$host/git/$gituser/$repo'<br>
+	<b>push:</b> hjgit://'$host/git/$gituser/$repo'<br>'
 if(test -f $repodir/contact)
 	echo '	<b>patches to: </b>'^`$nl{cat $repodir/contact}^'<br>'
 echo '	</div>'
--- a/log
+++ b/log
@@ -35,7 +35,7 @@
 }
 cd $gitfs/$ref/tree
 echo '	<p>
-	<a href="/'$gituser/$repo'/HEAD/feed.rss">RSS feed</a>
+	<a href="/git/'$gituser/$repo'/HEAD/feed.rss">RSS feed</a>
 	</p>
 	<p>'
 shortlog $gituser $repo $ref 100
--- a/md2html
+++ b/md2html
@@ -9,7 +9,7 @@
 
 cache=/usr/web/cache/$1.cache
 tcache=/usr/web/cache/$1.cache.tmp.$pid
-if(test -e $cache && ! test $cache -older 1m){
+if(test -e $cache && ! test $cache -older 1h){
 	exec cat $cache
 	exit
 }
@@ -19,7 +19,10 @@
 
 {
 	prelude '' 'main'
-	echo '<img src="/'$logo'" height="200px" width="200px"/><br/>'
-	
+
 	markdown $repo/$1.md
+echo '</article>
+</body>
+</html>
+'
 } | tee $tcache && mv $tcache $cache
--- a/mkfile
+++ b/mkfile
@@ -2,8 +2,8 @@
 	newrepo
 
 PAGEFILES=\
-	clone\
-	list\
+	bloglist\
+	gitlist\
 	info\
 	files\
 	branches\
--- a/show
+++ b/show
@@ -26,12 +26,12 @@
 date=`''{date `{mtime $gitfs/$ref/msg | awk '{print $1}'}}
 msg=`''{htcat $gitfs/$ref/msg}
 echo '	<p>
-	<a href="/'$gituser/$repo/$refname'/_patch">Download patch</a><br/>
+	<a href="/git/'$gituser/$repo/$refname'/_patch">Download patch</a><br/>
 	</p>
 	<p>
-	<b>ref:</b> <a href="/'$gituser/$repo/$refname'/files.html">'$refname'</a><br/>'
+	<b>ref:</b> <a href="/git/'$gituser/$repo/$refname'/files.html">'$refname'</a><br/>'
 if(! ~ $#oldcommit 0) {
-	echo '<b>parent:</b> <a href="/'$gituser/$repo/$oldcommit'/files.html">'$oldcommit'</a><br/>'
+	echo '<b>parent:</b> <a href="/git/'$gituser/$repo/$oldcommit'/files.html">'$oldcommit'</a><br/>'
 }
 echo '	<b>author:</b> '$author'<br/>
 	<b>date:</b> '$date'
--- a/usr
+++ b/usr
@@ -13,7 +13,6 @@
 '
 
 prelude '' 'git host'
-echo '<img src="/'$logo'" width="200px" height="200px" /><br/>'
 
 echo '<h2>'^$usr^'</h2>'
 if(test -f $usr/desc.html)
@@ -28,7 +27,7 @@
 for(repo in `$nl{ls $usr/}){
 	name=`{basename $repo}
 	if(test -e $repo/.git/webpublish){
-		echo '<dt><a href="/'$repo'/HEAD/info.html">'$name'</a></dt>'
+		echo '<dt><a href="/git/'$repo'/HEAD/info.html">'$name'</a></dt>'
 		echo '<dd>'
 		if(test -f $repo/.git/desc)
 			htcat $repo/.git/desc
--- a/view
+++ b/view
@@ -27,23 +27,23 @@
 user_prelude $gituser $repo $hash
 
 echo '	<p>
-	<b>ref:</b> <a href="'/$gituser/$repo/$hash/files.html'">'$hash'</a><br/>'
+	<b>ref:</b> <a href="'/git/$gituser/$repo/$hash/files.html'">'$hash'</a><br/>'
 echo $file | htcat | awk -F/ '{
 	user = ENVIRON["gituser"]
 	repo = ENVIRON["repo"]
 	hash = ENVIRON["hash"]
 	url="/" user "/" repo "/" hash
-	printf("<b>dir:</b> <a href=\"%s/f.html\">/</a>", url);
+	printf("<b>dir:</b> <a href=\"/git/%s/f.html\">/</a>", url);
 	for(i = 1; i <= NF; i++){
 		if($i != "."){
 			url=url"/"$i
-			printf("<a href=\"%s/f.html\">%s</a>/", url, $i)
+			printf("<a href=\"/git/%s/f.html\">%s</a>/", url, $i)
 		}
 	}
 	printf("</p>")
 }'
 if(test -f $file){
-	echo '	<a href="'/$gituser/$repo/$hash/$file'/raw">View raw version</a>'
+	echo '	<a href="'/git/$gituser/$repo/$hash/$file'/raw">View raw version</a>'
 	type=`{file -m $file}
 	switch($type){
 	case text/*
@@ -51,7 +51,7 @@
 		htcat $file
 		echo '	</pre>'
 	case image/*
-		echo '	<br/><div><img src="'/$gituser/$repo/$hash/$file'/raw" /></div>'
+		echo '	<br/><div><img src="'/git/$gituser/$repo/$hash/$file'/raw" /></div>'
 	case *
 		echo '	<p>Binary file not displayed</p>'
 	}
@@ -62,7 +62,7 @@
 	for(f in `$nl{ls}){
 		url=`$nl{echo -n $f/f.html | urlencode}
 		fname=`$nl{echo -n $f | htcat}
-		echo -n '<a href="'$url'">'$fname
+		echo -n '<a href="/git'$url'">'$fname
 		if (test -d $f) echo '/'
 		echo '</a><br/>'
 	}