From c795d76a19aee2f3f7f8a32e9f66a111f348a887 Mon Sep 17 00:00:00 2001 From: Prefetch Date: Mon, 24 Jul 2023 21:33:11 +0200 Subject: Add cgit config --- cgit/cgitrc | 103 ++++++++++++++++++++++++++++++++++++++++++ cgit/head.html | 17 +++++++ cgit/syntax-highlighting.dash | 28 ++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 cgit/cgitrc create mode 100644 cgit/head.html create mode 100755 cgit/syntax-highlighting.dash (limited to 'cgit') diff --git a/cgit/cgitrc b/cgit/cgitrc new file mode 100644 index 0000000..916a96c --- /dev/null +++ b/cgit/cgitrc @@ -0,0 +1,103 @@ +###################### +# cgit configuration # +###################### + +# cgit's root is at https://prefetch.eu/code/ +virtual-root=/code/ + +# Links to external resources +css=/infra/css/cgit.css +favicon=/infra/image/icon/favicon.ico?v=20221106 +logo=/infra/image/logo-cgit.png +logo-link=/ +head-include=/etc/cgit/head.html + +# Internet exposure settings +enable-http-clone=1 +robots=index,nofollow,noarchive,noimageindex +noplainemail=1 + +# Enable caching of up to 9000 pages (disabled by default). +cache-size=9000 +# Default cache directory must be writeable by nginx +cache-root=/var/cache/cgit +# Only this TTL is set to forever by default, let's change that +cache-static-ttl=15 + +# Copied from the original .sh: BusyBox doesn't work but dash does +source-filter=/etc/cgit/syntax-highlighting.dash +#about-filter= + +# General flavor text for site +root-title=Prefetch's software +root-desc=The software is provided "as is", without warranty of any kind, because I don't want to get sued into oblivion. +#root-readme= +#header= +#footer= + + +####################### +# Public repositories # +####################### + +# Keep order of sections and repositories +section-sort=0 +# Allow longer repository descriptions +max-repodesc-length=120 + +section=Web development + +repo.url=prefetch-jekyll +repo.path=/home/git/prefetch-jekyll.git/ +repo.desc=My website's source code for Jekyll (a static site generator). +repo.owner=Prefetch + +repo.url=prefetch-hugo +repo.path=/home/git/prefetch-hugo.git/ +repo.desc=(OLD) My website's Hugo source code before I migrated to Jekyll. Please excuse the mess. +repo.owner=Prefetch + +repo.url=prefetch-zola +repo.path=/home/git/prefetch-zola.git/ +repo.desc=(OLD) My website's Zola source code before I migrated to Hugo. Please excuse the mess. +repo.owner=Prefetch + + +section=Basic programming exercises + +repo.url=aoc2015 +repo.path=/home/git/aoc2015.git/ +repo.desc=Advent of Code 2015 solutions in Python 3 (made in 2022, not 2015) +repo.owner=Prefetch + +repo.url=aoc2016 +repo.path=/home/git/aoc2016.git/ +repo.desc=Advent of Code 2016 solutions in Rust (made in 2023, not 2016) +repo.owner=Prefetch + + +section=More advanced programming projects + +repo.url=deft-bs +repo.path=/home/git/deft-bs.git/ +repo.desc=Band structure (BS) calculations for non-metals by density functional theory (DFT) in Python. Currently bugged! +repo.owner=Prefetch + +repo.url=linen +repo.path=/home/git/linen.git/ +repo.desc=Linux multithreading library written in x86_64 assembly +repo.owner=Prefetch + + +section=Configurations and scripts + +repo.url=configs-public +repo.path=/home/git/configs-public.git/ +repo.desc=My dotfiles and other configs I use on various systems +repo.owner=Prefetch + +repo.url=winvm-v1 +repo.path=/home/git/winvm-v1.git/ +repo.desc=(OLD) Script to start a Windows VM with GPU passthrough. +repo.owner=Prefetch + diff --git a/cgit/head.html b/cgit/head.html new file mode 100644 index 0000000..5abf836 --- /dev/null +++ b/cgit/head.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/cgit/syntax-highlighting.dash b/cgit/syntax-highlighting.dash new file mode 100755 index 0000000..9db14f9 --- /dev/null +++ b/cgit/syntax-highlighting.dash @@ -0,0 +1,28 @@ +#!/usr/bin/dash + +# This script requires a shell supporting the ${var##pattern} syntax. +# It is supported by at least dash and bash, however not by busybox. +# +# 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 ) + +# Store filename and extension in local variables +BASENAME="$1" +EXTENSION="${BASENAME##*.}" + +# Use .txt as a sensible default format +[ "${BASENAME}" = "${EXTENSION}" ] && EXTENSION=txt +[ -z "${EXTENSION}" ] && EXTENSION=txt + +# Map Makefile and Makefile.* to .mk +[ "${BASENAME%%.*}" = "Makefile" ] && EXTENSION=mk + +# This is for version 3 and above of the "highlight" package +exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null -- cgit v1.2.3