From aee52406b4409c1b3cfc717ed777688ab568138f Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 25 Feb 2024 12:45:55 +0000 Subject: cgit syntax highlight using mycgit.css mycgit.css import cgit.css and highlight.css. Because cgit.css is not a pacman backup file and it will be overwritten once cgit update. I can also update highlight.css automatically via pacman hook or `upd`. Also, I think `highlight` not using `--inline-css` maybe is a better way performance wise and more elegant (less messy generated html source code). --- etc/cgitrc | 2 ++ etc/nginx/nginx.conf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'etc') 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; } -- cgit v1.2.3-70-g09d2