diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-08-31 17:10:07 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-08-31 17:10:07 +0200 |
| commit | 66b54db812b01f5b944b0e5694a1473bdbcbaf32 (patch) | |
| tree | 177d8c6120c8df5e5a63162417258e1522951c11 /custom/about-filter.sh | |
| download | cgit-config-66b54db812b01f5b944b0e5694a1473bdbcbaf32.tar.gz cgit-config-66b54db812b01f5b944b0e5694a1473bdbcbaf32.zip | |
Diffstat (limited to 'custom/about-filter.sh')
| -rwxr-xr-x | custom/about-filter.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/custom/about-filter.sh b/custom/about-filter.sh new file mode 100755 index 0000000..80456da --- /dev/null +++ b/custom/about-filter.sh | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | case "$1" in | ||
| 4 | *.md) | ||
| 5 | lowdown --html-no-skiphtml --html-no-escapehtml | ||
| 6 | ;; | ||
| 7 | *.html) | ||
| 8 | cat - | ||
| 9 | ;; | ||
| 10 | *) | ||
| 11 | # Copied from default cgit txt2html filter, with added id for styling | ||
| 12 | echo "<pre id=\"nobox\">" | ||
| 13 | sed "s|&|\\&|g;s|'|\\'|g;s|\"|\\"|g;s|<|\\<|g;s|>|\\>|g" | ||
| 14 | echo "</pre id=\"nobox\">" | ||
| 15 | ;; | ||
| 16 | esac | ||
