ref: e48d20254f76737de1cd75c32e2fd2efc64fb26c
parent: 396ba6b980ebd5a406cfef1cb95a049bbd7b3c58
author: uriel <[email protected]>
date: Mon May 28 00:07:40 EDT 2007
A bunch of stuff before breaking things up
--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -9,6 +9,8 @@
# config
body=index
+siteTitle=''
+siteSubTitle=''
title=Title
template=default
sidebar=sidebar
@@ -17,6 +19,7 @@
if (! ~ $#args 0 && ! ~ $args '') {
title=$args($#args)
+ title=`{echo $title | sed 's/_/ /' }
body=`{ echo -n $"args |sed 's, ,/,g' }
}
@@ -36,9 +39,52 @@
body=`{echo tpl/^$"body^.md | sed 's, ,/,' }
+# Sidebar
+fn menu {
+ ls -F $1 | sed -e 's,^./,,' -e 's,\.md$,,' | grep -v '^_'| awk '
+ BEGIN { print "<ul class=\"sidebar\">" }
+ END { print "</ul>" }
+ /^([a-zA-Z0-9_\-]+[\/*]?)+$/ && ! /index$/ {
+ isdir = match($0, "/$")
+ sub("[*/]$", "") # The '*' makes no sense to me
+
+ if(isdir)
+ d = "/"
+ bname = $0
+ sub("^(.*/)?([0-9]+_)?", "", bname)
+ gsub("_", " ", bname)
+
+ bname = bname d
+
+ if(index(ENVIRON["REQUEST_URI"], "/" $0) == 1) {
+ if(isdir) {
+ print "<li><a href=\"/" $0 d "\">»<i> " bname "</i></a>"
+ system("rc -c ''menu " $0 "''")
+ } else {
+ print "<li><a href=\"/" $0 d "\" class=\"thisPage\">»<i> " bname "</i></a>"
+ }
+ } else
+ print "<li><a href=\"/" $0 d "\">› " bname "</a>"
+
+ print "</li>"
+
+ }'
+
+}
+
+fn gensidebar {
+ echo '<p class="sideBarTitle">Considered harmful:</p>'
+ cd tpl
+ menu .
+ cd ..
+}
+
+
+# Body
+
template.awk $template | rc
-echo '<pre>'
-#echo $"args
-#env
+# Debug junk
+#echo '<pre>'
+#env
--- /dev/null
+++ b/bin/sidebar.tpl
@@ -1,0 +1,1 @@
+
--- a/etc/initrc
+++ b/etc/initrc
@@ -1,2 +1,3 @@
title=cat-v
-sitetitle=harmful.cat-v.org
+siteTitle='cat-v'
+siteSubTitle='Considered harmful'
--- a/pub/sitemap.txt
+++ b/pub/sitemap.txt
@@ -1,10 +1,15 @@
http://harmful.cat-v.org/
+http://harmful.cat-v.org/society/sweden
+http://harmful.cat-v.org/society/children/
+http://harmful.cat-v.org/society/children/fuck_the_children
+http://harmful.cat-v.org/society/children/i_dont_care
http://harmful.cat-v.org/cat-v/
+http://harmful.cat-v.org/software/firefox
http://harmful.cat-v.org/software/
http://harmful.cat-v.org/software/xml
-http://harmful.cat-v.org/children/
-http://harmful.cat-v.org/children/fuck_the_children
-http://harmful.cat-v.org/children/i_dont_care
+http://harmful.cat-v.org/software/object_oriented_programming
+http://harmful.cat-v.org/science/global_warming
+http://harmful.cat-v.org/economics/intellectual_property
http://harmful.cat-v.org/economics/subsidies
http://harmful.cat-v.org/economics/
http://harmful.cat-v.org/economics/minimum_wage
--- a/pub/style/style.css
+++ b/pub/style/style.css
@@ -83,6 +83,10 @@
font-style: italic;
}
+.headerTitle a {
+ color: black;
+ text-decoration: none;
+}
.subHeader {
display: none;
--- a/tpl/_inc/sidebar.tpl
+++ /dev/null
@@ -1,35 +1,0 @@
-echo '<p class="sideBarTitle">Considered harmful:</p>'
-fn menu {
- ls -F $1 | sed -e 's,^./,,' -e 's,\.md$,,' | grep -v '^_'| awk '
- BEGIN { print "<ul class=\"sidebar\">" }
- END { print "</ul>" }
- /^([a-zA-Z0-9_\-]+[\/*]?)+$/ && ! /index$/ {
- isdir = match($0, "/$")
- sub("[*/]$", "") # The '*' makes no sense to me
-
- if(isdir)
- d = "/"
- bname = $0
- sub("^(.*/)?([0-9]+_)?", "", bname)
- gsub("_", " ", bname)
-
- bname = bname d
-
- if(index(ENVIRON["REQUEST_URI"], "/" $0) == 1) {
- if(isdir) {
- print "<li><a href=\"/" $0 d "\">»<i> " bname "</i></a>"
- system("rc -c ''menu " $0 "''")
- } else {
- print "<li><a href=\"/" $0 d "\" class=\"thisPage\">»<i> " bname "</i></a>"
- }
- } else
- print "<li><a href=\"/" $0 d "\">› " bname "</a>"
-
- print "</li>"
-
- }'
-
-}
-cd tpl
-menu .
-cd ..
--- a/tpl/default.tpl
+++ b/tpl/default.tpl
@@ -8,11 +8,10 @@
<meta name="verify-v1" content="6zEoK0WMlnLmIS/w7Pnh6+srZECHsvnMGN0kQmowSGk=" />
-% echo '<title>'$title'</title>'
+% echo '<title>'$"title' - '$"siteTitle'</title>'
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta name="copyright" content="© 2007 by k" />
- <meta name="author" content="uriel" />
+ <meta name="author" content="k" />
<link rel="stylesheet" href="/style/style.css" type="text/css" media="screen" title="default" />
<link rel="stylesheet alternative" type="text/css" href="/style/style_old.css" media="screen" title="Old Style" />
@@ -37,7 +36,7 @@
</div>
<div class="midHeader">
- <h1 class="headerTitle">cat-v <span id="headerSubTitle">Considered harmful</span></h1>
+%echo '<h1 class="headerTitle"><a href="/">'$"siteTitle' <span id="headerSubTitle">'$"siteSubTitle'</span></a></h1>'
</div>
<div class="subHeader">
@@ -47,9 +46,8 @@
%if (! ~ $#sidebar 0) {
<div id="side-bar">
-% # template.awk $sidebar | rc
<div>
-% cat $sidebar | rc
+% gensidebar
</div>
<div class="spam" style="padding: 1em 0;">
@@ -127,11 +125,8 @@
<div id="footer">
<!--
-%#echo $body
<br class="doNotDisplay doNotPrint" />
<div class="right">
-Author: <a href="http://cat-v.org/who/uriel/">uriel</a>
-<br />
Hosted at: <a href="http://cat-v.org">cat-v.org</a>
</div>
-->
--- a/tpl/software/index.md
+++ b/tpl/software/index.md
@@ -15,3 +15,4 @@
that is reliability. The price of reliability is the pursuit of the utmost
simplicity. It is a price which the very rich find most hard to pay.*" -- C.A.R. Hoare
+"*It's a curious thing about our industry: not only do we not learn from our mistakes, we also don't learn from our successes.*" -- Keith Braithwaite
--- a/tpl/software/xml.md
+++ b/tpl/software/xml.md
@@ -4,7 +4,7 @@
"*The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well."* -- Phil Wadler, POPL 2003
-For now see [xmlsucks.org](http://www.xmlsucks.org).
+For now see [xmlsucks](http://www.xmlsucks.com).
Alternatives
------------
@@ -30,3 +30,6 @@
They won't be thrown. They will be slowly driven under the nails, so that
victim could experience the joy equal to that of dealing with XML.
+"*Some part of me desperately wants to believe that XML-RPC is some kind of elaborate joke, like a cross between Discordianism and IP Over Avian Carriers.*" -- Ex-Cyber on #plan9
+
+"*XML is simply lisp done wrong.*" -- Alan Cox