summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-18 21:40:50 -0500
committerJune McEnroe <june@causal.agency>2019-12-18 21:40:50 -0500
commit480a5024344b5e5b3562c3d663206fc372235510 (patch)
treeeb8223bc6877988d26fb9d42f3246271d867f797
parentBail from hi if input is binary (diff)
downloadsrc-480a5024344b5e5b3562c3d663206fc372235510.tar.gz
src-480a5024344b5e5b3562c3d663206fc372235510.zip
Add git.causal.agency cgit config
Diffstat (limited to '')
-rw-r--r--www/git.causal.agency/.gitignore3
-rw-r--r--www/git.causal.agency/Makefile21
-rw-r--r--www/git.causal.agency/cgitrc27
-rw-r--r--www/git.causal.agency/custom.css24
-rw-r--r--www/git.causal.agency/source-filter.sh13
5 files changed, 88 insertions, 0 deletions
diff --git a/www/git.causal.agency/.gitignore b/www/git.causal.agency/.gitignore
new file mode 100644
index 00000000..b6ba7d24
--- /dev/null
+++ b/www/git.causal.agency/.gitignore
@@ -0,0 +1,3 @@
+hi
+source-filter
+ttpre
diff --git a/www/git.causal.agency/Makefile b/www/git.causal.agency/Makefile
new file mode 100644
index 00000000..5e8d7bf4
--- /dev/null
+++ b/www/git.causal.agency/Makefile
@@ -0,0 +1,21 @@
+ETC = /usr/local/etc
+WWW = /usr/local/www/cgit
+LIBEXEC = /usr/local/libexec
+
+BIN = ../../bin
+BINS = source-filter ttpre hi
+
+install: cgitrc custom.css ${BINS}
+	install -m 644 cgitrc ${ETC}
+	install -m 644 custom.css ${WWW}
+	install ${BINS} ${LIBEXEC}
+
+ttpre hi:
+	${MAKE} -C ${BIN} $@
+
+ttpre: ${BIN}/ttpre.c
+
+hi: ${BIN}/hi.c
+
+clean:
+	rm -f ${BINS}
diff --git a/www/git.causal.agency/cgitrc b/www/git.causal.agency/cgitrc
new file mode 100644
index 00000000..4a1aa904
--- /dev/null
+++ b/www/git.causal.agency/cgitrc
@@ -0,0 +1,27 @@
+root-title=causal agency
+root-desc=code toilet
+
+clone-url=https://$HTTP_HOST/$CGIT_REPO_URL
+snapshots=tar.gz zip
+
+enable-blame=1
+enable-commit-graph=1
+enable-subject-links=1
+enable-follow-links=1
+enable-index-owner=0
+repository-sort=age
+branch-sort=age
+
+css=/custom.css
+email-filter=/usr/local/libexec/cgit-email
+about-filter=/usr/local/libexec/source-filter
+source-filter=/usr/local/libexec/source-filter
+
+readme=:README.7
+readme=:README
+
+remove-suffix=1
+enable-git-config=1
+scan-path=/home/june/pub
+
+cache-size=1024
diff --git a/www/git.causal.agency/custom.css b/www/git.causal.agency/custom.css
new file mode 100644
index 00000000..7bec1dea
--- /dev/null
+++ b/www/git.causal.agency/custom.css
@@ -0,0 +1,24 @@
+@import url("cgit.css");
+
+div#cgit {
+	-moz-tab-size: 4;
+	tab-size: 4;
+}
+
+div#cgit table.blob td.linenumbers a:focus {
+	color: goldenrod;
+	text-decoration: underline;
+	outline: none;
+}
+
+div#cgit .hi.Keyword { color: dimgray; }
+div#cgit .hi.Macro { color: green; }
+div#cgit .hi.Tag { color: inherit; text-decoration: underline; }
+div#cgit .hi.Tag:focus { color: goldenrod; outline: none; }
+div#cgit .hi.String { color: teal; }
+div#cgit .hi.Format { color: teal; font-weight: bold; }
+div#cgit .hi.Interp { color: olive; }
+div#cgit .hi.Comment { color: navy; }
+div#cgit .hi.Todo { color: navy; font-weight: bold; }
+div#cgit .hi.DiffOld { color: red; }
+div#cgit .hi.DiffNew { color: green; }
diff --git a/www/git.causal.agency/source-filter.sh b/www/git.causal.agency/source-filter.sh
new file mode 100644
index 00000000..ce9e3f8b
--- /dev/null
+++ b/www/git.causal.agency/source-filter.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+case "$1" in
+	(*.[1-9])
+		/usr/bin/mandoc -T utf8 \
+			| /usr/local/libexec/ttpre \
+			| /usr/bin/sed -E \
+				's,([a-z0-9_-]+)[(]([1-9])[)],<a href="\1.\2">&</a>,g'
+		;;
+	(*)
+		exec /usr/local/libexec/hi -t -n "$1" -f html -o anchor
+		;;
+esac