From 90926642b0231002e2b2a1a5e18c10d0f8e8ccea Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 25 Feb 2024 03:37:01 +0000 Subject: try cgit highlight --- etc/cgitrc | 2 ++ usr/lib/cgit/filters/syntax-highlighting-edited.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/cgitrc b/etc/cgitrc index 86b26dd4..416ecf76 100644 --- a/etc/cgitrc +++ b/etc/cgitrc @@ -5,6 +5,8 @@ # https://stackoverflow.com/questions/16182421/cgit-and-nginx-url-rewrite virtual-root=/ +source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh + root-title=flylightning.xyz git repositories root-desc= diff --git a/usr/lib/cgit/filters/syntax-highlighting-edited.sh b/usr/lib/cgit/filters/syntax-highlighting-edited.sh index 840bc34f..3de95fa5 100755 --- a/usr/lib/cgit/filters/syntax-highlighting-edited.sh +++ b/usr/lib/cgit/filters/syntax-highlighting-edited.sh @@ -115,7 +115,7 @@ EXTENSION="${BASENAME##*.}" # found (for example) on EPEL 6. # # This is for version 2 -exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null +#exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null # This is for version 3 -#exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null +exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" 2>/dev/null -- cgit v1.2.3-70-g09d2