aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2020-06-25 06:42:04 -0400
committerKylie McClain <kylie@somas.is>2020-06-25 06:42:14 -0400
commitd4864fdbabaddf4bc0211170576fceb9a14fd155 (patch)
tree6bd67cc344dcc36cf34c65d4d3437311bdd5463c
parent2bf4f7e01042cec35853a84ddc788f8c0bf5a97b (diff)
downloadgitolite-admin-d4864fdbabaddf4bc0211170576fceb9a14fd155.tar.gz
gitolite-admin-d4864fdbabaddf4bc0211170576fceb9a14fd155.tar.xz
gitolite-admin-d4864fdbabaddf4bc0211170576fceb9a14fd155.zip
cgit: add an about filter
-rw-r--r--cgit/cgitrc (renamed from cgitrc)1
-rwxr-xr-xcgit/filters/about.sh15
2 files changed, 16 insertions, 0 deletions
diff --git a/cgitrc b/cgit/cgitrc
index 38c1251..188feba 100644
--- a/cgitrc
+++ b/cgit/cgitrc
@@ -24,6 +24,7 @@ snapshots=tar.xz tar.gz zip
# Don't include the .git in repositories.
remove-suffix=1
+about-filter=/srv/git/.gitolite/cgit/filters/about.sh
readme=:README
project-list=/srv/git/projects.list
diff --git a/cgit/filters/about.sh b/cgit/filters/about.sh
new file mode 100755
index 0000000..437c29c
--- /dev/null
+++ b/cgit/filters/about.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+case "$(printf '%s' "${1}" | tr '[:upper:]' '[:lower:]')"
+ *.adoc|*.asciidoc)
+ exec asciidoctor \
+ -S secure \
+ -b html5 \
+ -a source-highlighter=pygments \
+ -s
+ ;;
+ *)
+ exec /usr/lib/cgit/filters/html-converters/txt2html
+ ;;
+esac
+