summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/cgitrc2
-rw-r--r--etc/nginx/nginx.conf2
-rwxr-xr-xusr/lib/cgit/filters/syntax-highlighting-edited.sh4
-rw-r--r--usr/share/webapps/cgit/highlight.css24
-rw-r--r--usr/share/webapps/cgit/mycgit.css2
5 files changed, 31 insertions, 3 deletions
diff --git a/etc/cgitrc b/etc/cgitrc
index 32a934f6..056877d2 100644
--- a/etc/cgitrc
+++ b/etc/cgitrc
@@ -2,6 +2,8 @@
# https://wiki.gentoo.org/wiki/User:Halcon/HOWTO_cgit_uwsgi_nginx
# `man cgitrc`
+css=/mycgit.css
+
# https://stackoverflow.com/questions/16182421/cgit-and-nginx-url-rewrite
virtual-root=/
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
index fc7b065b..17b23af5 100644
--- a/etc/nginx/nginx.conf
+++ b/etc/nginx/nginx.conf
@@ -164,7 +164,7 @@ http {
ssl_certificate_key /etc/nginx/flylightning.key;
# Serve static files with nginx
- location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) {
+ location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt|highlight.css|mycgit.css) {
root /usr/share/webapps/cgit;
expires 30d;
}
diff --git a/usr/lib/cgit/filters/syntax-highlighting-edited.sh b/usr/lib/cgit/filters/syntax-highlighting-edited.sh
index f3c8072d..32069e20 100755
--- a/usr/lib/cgit/filters/syntax-highlighting-edited.sh
+++ b/usr/lib/cgit/filters/syntax-highlighting-edited.sh
@@ -107,7 +107,7 @@ esac
# `--force` needed for highlight; one example is `< textfile highlight -O ansi --force`, without `--force` will error 1 and no output
if [ "$syntax" ]; then
- exec highlight --force --inline-css -f -I -O xhtml -S "$syntax" 2>/dev/null
+ exec highlight --force -f -I -O xhtml -S "$syntax" 2>/dev/null
else
- exec highlight --force --inline-css -f -I -O xhtml --syntax-by-name "$1" 2>/dev/null
+ exec highlight --force -f -I -O xhtml --syntax-by-name "$1" 2>/dev/null
fi
diff --git a/usr/share/webapps/cgit/highlight.css b/usr/share/webapps/cgit/highlight.css
new file mode 100644
index 00000000..bbce7f95
--- /dev/null
+++ b/usr/share/webapps/cgit/highlight.css
@@ -0,0 +1,24 @@
+/* Style definition file generated by highlight 4.10, http://www.andre-simon.de/ */
+/* highlight theme: Kwrite Editor */
+body.hl { background-color:#e0eaee; }
+pre.hl { color:#000000; background-color:#e0eaee; font-size:10pt; font-family:'Courier New',monospace; white-space: pre-wrap; }
+.hl.num { color:#b07e00; }
+.hl.esc { color:#ff00ff; }
+.hl.sng { color:#bf0303; }
+.hl.pps { color:#818100; }
+.hl.slc { color:#838183; font-style:italic; }
+.hl.com { color:#838183; font-style:italic; }
+.hl.ppc { color:#008200; }
+.hl.opt { color:#000000; }
+.hl.ipl { color:#0057ae; }
+.hl.lin { color:#555555; user-select: none; }
+.hl.hvr { cursor:help; }
+.hl.erm { color:#ff0000; font-weight:bold; border:solid 1px red; margin-left: 3em; }
+.hl.err { color:#ff0000; font-weight:bold; }
+.hl.kwa { color:#000000; font-weight:bold; }
+.hl.kwb { color:#0057ae; }
+.hl.kwc { color:#000000; }
+.hl.kwd { color:#010181; }
+.hl.kwe { color:#0d5bc3; }
+.hl.kwf { color:#750dc3; }
+
diff --git a/usr/share/webapps/cgit/mycgit.css b/usr/share/webapps/cgit/mycgit.css
new file mode 100644
index 00000000..ed2ecd88
--- /dev/null
+++ b/usr/share/webapps/cgit/mycgit.css
@@ -0,0 +1,2 @@
+@import "cgit.css";
+@import "highlight.css";