From 6f080713489cfc11bfc4fc77b57ea9398bef424b Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 15 Jan 2025 13:48:32 +0100 Subject: feat: things!! :3 --- image/Caddyfile | 2 ++ image/cgitrc | 7 +++++-- image/filters/about-formatting | 27 +++++++++++++++++++++++++++ image/filters/email-libravatar.lua | 0 image/filters/syntax-highlighting.sh | 0 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100755 image/filters/about-formatting mode change 100644 => 100755 image/filters/email-libravatar.lua mode change 100644 => 100755 image/filters/syntax-highlighting.sh (limited to 'image') diff --git a/image/Caddyfile b/image/Caddyfile index 56f89a0..82e6020 100644 --- a/image/Caddyfile +++ b/image/Caddyfile @@ -17,6 +17,8 @@ http:// { } } + # you may want to handle /assets/md.css (for example doing a rewrite to /cgit-assets.git/plain/markdown.css) if you use the default markdown handler + reverse_proxy unix//run/fcgiwrap/fcgiwrap.sock { transport fastcgi { env DOCUMENT_ROOT /usr/share/webapps/cgit diff --git a/image/cgitrc b/image/cgitrc index 61a5944..6214b74 100644 --- a/image/cgitrc +++ b/image/cgitrc @@ -9,7 +9,7 @@ cache-size=1000 # The clone prefixes, used to show the user where to clone from clone-prefix=https://git.estrogen.zone ssh://git@git.estrogen.zone -# Use /cgit.css or https://git.estrogen.zone/cgit-assets.git/plain/cgit.css if you don't have this repo available +# Use /cgit.css or https://git.estrogen.zone/cgit-assets.git/plain/cgit.css if you don't have this repo on your cgit css=/cgit-assets.git/plain/cgit.css # Specify your own icon's URL here @@ -55,9 +55,12 @@ readme=:README.rst readme=:readme.rst readme=:README.md readme=:readme.md +readme=:README.txt +readme=:readme.txt readme=:README readme=:readme #readme=:README.html +#readme=:readme.html # if cgit messes up links, use a virtual-root. For example, cgit.example.org/ has this value: virtual-root=/ @@ -89,7 +92,7 @@ email-filter=lua:/usr/lib/cgit/filters/extra/email-libravatar.lua # commit-filter=exec:/usr/lib/cgit/filters/extra/commit.sh # Handle the about pages -about-filter=/usr/lib/cgit/filters/about-formatting.sh +about-filter=/usr/lib/cgit/filters/extra/about-formatting.sh # Handle syntax highlighting source-filter=/usr/lib/cgit/filters/syntax-highlighting-uwu.sh diff --git a/image/filters/about-formatting b/image/filters/about-formatting new file mode 100755 index 0000000..edc7ec2 --- /dev/null +++ b/image/filters/about-formatting @@ -0,0 +1,27 @@ +#!/bin/sh + +# This may be used with the about-filter or repo.about-filter setting in cgitrc. +# It passes formatting of about pages to differing programs, depending on the usage. + +# Markdown support requires python and markdown-python. +# RestructuredText support requires python and docutils. +# Man page support requires groff. + +# The following environment variables can be used to retrieve the configuration +# of the repository for which this script is called: +# CGIT_REPO_URL ( = repo.url setting ) +# CGIT_REPO_NAME ( = repo.name setting ) +# CGIT_REPO_PATH ( = repo.path setting ) +# CGIT_REPO_OWNER ( = repo.owner setting ) +# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +# CGIT_REPO_SECTION ( = section setting ) +# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) + +cd "$(dirname $0)/html-converters/" +case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in + *.markdown|*.mdown|*.md|*.mkd) exec /usr/bin/markdown-tool; ;; + *.rst) exec ./rst2html; ;; + *.[1-9]) exec ./man2html; ;; + *.htm|*.html) exec cat; ;; + *.txt|*) exec ./txt2html; ;; +esac diff --git a/image/filters/email-libravatar.lua b/image/filters/email-libravatar.lua old mode 100644 new mode 100755 diff --git a/image/filters/syntax-highlighting.sh b/image/filters/syntax-highlighting.sh old mode 100644 new mode 100755 -- cgit v1.2.3