summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrefetch2023-07-24 21:33:11 +0200
committerPrefetch2023-07-24 21:33:11 +0200
commitc795d76a19aee2f3f7f8a32e9f66a111f348a887 (patch)
treea9ab40db412ac51fc5f49f1139ba3a68d7b87129
parentbc337e0d7dfc035068202bba67e1b3898f54db02 (diff)
Add cgit config
-rw-r--r--cgit/cgitrc103
-rw-r--r--cgit/head.html17
-rwxr-xr-xcgit/syntax-highlighting.dash28
3 files changed, 148 insertions, 0 deletions
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 @@
+
+<!-- Start of /etc/cgit/head.html -->
+<meta charset="utf-8"/>
+
+<!-- Generated by https://realfavicongenerator.net/ -->
+<link rel="apple-touch-icon" sizes="180x180" href="/infra/image/icon/apple-touch-icon.png?v=20221106"/>
+<link rel="icon" type="image/png" sizes="32x32" href="/infra/image/icon/favicon-32x32.png?v=20221106"/>
+<link rel="icon" type="image/png" sizes="16x16" href="/infra/image/icon/favicon-16x16.png?v=20221106"/>
+<link rel="manifest" href="/infra/image/icon/site.webmanifest?v=20221106"/>
+<link rel="mask-icon" href="/infra/image/icon/safari-pinned-tab.svg?v=20221106" color="#000000"/>
+<meta name="msapplication-TileColor" content="#603cba"/>
+<meta name="msapplication-config" content="/infra/image/icon/browserconfig.xml?v=20221106"/>
+<meta name="theme-color" content="#ffffff"/>
+
+<script data-goatcounter="https://prefetch.goatcounter.com/count" async src="/infra/js/count.js?v=20230709"></script>
+<!-- End of /etc/cgit/head.html -->
+
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