From 53c787c651df22bf0d8c5e2c7117143f8a0e2359 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:01:33 -0500 Subject: small changes to cgit --- modules/services/nixos/cgit/Logo.svg | 18 ------------ modules/services/nixos/cgit/cgit-head.html | 19 +++++++------ modules/services/nixos/cgit/cgit.css | 45 +++++++----------------------- modules/services/nixos/cgit/default.nix | 10 +++---- 4 files changed, 25 insertions(+), 67 deletions(-) delete mode 100644 modules/services/nixos/cgit/Logo.svg (limited to 'modules/services/nixos/cgit') diff --git a/modules/services/nixos/cgit/Logo.svg b/modules/services/nixos/cgit/Logo.svg deleted file mode 100644 index 77eb306..0000000 --- a/modules/services/nixos/cgit/Logo.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/modules/services/nixos/cgit/cgit-head.html b/modules/services/nixos/cgit/cgit-head.html index da6140d..b0c74dd 100644 --- a/modules/services/nixos/cgit/cgit-head.html +++ b/modules/services/nixos/cgit/cgit-head.html @@ -19,21 +19,24 @@ const headerInfo = document.createElement("div"); headerInfo.className = "header-info"; - - const title = document.createElement("h1"); + const repo = main.querySelector("a:last-of-type"); - title.textContent = repo?.textContent.trim() ?? ""; + const title = document.createElement("h1"); + if (repo && repo !== main.querySelector("a:first-of-type")) { + title.textContent = repo.textContent.trim(); + } else { + title.textContent = document.title; // we must be on the title page + title.className = "main-page"; + } const desc = document.createElement("p"); - desc.className = "description"; + desc.className = "description" desc.textContent = description?.textContent.trim() ?? ""; headerInfo.append(title, desc); headerTop.append(logoLink, headerInfo); + header.append(headerTop); - const hr = document.createElement("hr"); - - header.append(headerTop, hr); oldHeader.replaceWith(header); - }); + }); diff --git a/modules/services/nixos/cgit/cgit.css b/modules/services/nixos/cgit/cgit.css index 25cff6e..8ac6aeb 100644 --- a/modules/services/nixos/cgit/cgit.css +++ b/modules/services/nixos/cgit/cgit.css @@ -1,5 +1,5 @@ -@import url('https://static.williamsfam.us.com/fonts.css'); -@import url('https://static.williamsfam.us.com/prose.css'); +@import url('https://collin.williamsfam.us.com/static/fonts.css'); +@import url('https://collin.williamsfam.us.com/static/prose.css'); :root { --bg: #121212; @@ -46,39 +46,10 @@ table { div#cgit { max-width: fit-content; + min-width: 904.9px; margin: 0 auto; } -table#header { - width: 100%; - margin-bottom: 1.5rem; - - td.logo { - width: 96px; - vertical-align: top; - } - - td.main { - font-family: var(--fontSerif); - font-size: 2rem; - font-weight: 600; - padding: 0 0 0 0.75rem; - white-space: nowrap; - - a { - color: var(--fg); - &:hover { color: var(--accent); } - } - } - - td.sub { - color: var(--muted); - padding-left: 0.75rem; - padding-top: 0.25rem; - font-family: var(--fontSerif); - } -} - td.form { text-align: right; } @@ -87,8 +58,8 @@ td.form { table.tabs { border-bottom: 2px solid var(--border); border-collapse: collapse; - margin-top: 2rem; - margin-bottom: 0; + margin: 0; + margin-top: 1rem; width: 100%; td { @@ -646,7 +617,7 @@ header { height: 5.5rem; flex-shrink: 0; background-color: #e6e6e6; - mask-image: url("https://static.williamsfam.us.com/Logo.svg"); + mask-image: url("https://collin.williamsfam.us.com/static/Logo.svg"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; @@ -663,6 +634,10 @@ header { font-family: var(--fontMono); /* makes more sense for a git repo title */ line-height: 1; margin: 0; + + &.main-page { + font-family: var(--fontSerif); /* makes more sense for the "Repositories" title of the main page*/ + } } } diff --git a/modules/services/nixos/cgit/default.nix b/modules/services/nixos/cgit/default.nix index 477e678..0ae3256 100644 --- a/modules/services/nixos/cgit/default.nix +++ b/modules/services/nixos/cgit/default.nix @@ -36,7 +36,7 @@ in { users.users."git" = { isSystemUser = true; group = "git"; - shell = lib.getExe pkgs.git; + shell = "${pkgs.git}/bin/git-shell"; home = "/var/lib/cgit"; createHome = true; @@ -59,8 +59,8 @@ in { enable-http-clone=1 enable-commit-graph=1 - root-title=git@ganymede - root-desc=Git repos associated with Ganymede + root-title=Repositories + root-desc=Git repos for my various personal projects readme=:README.md about-filter=${md2html}/bin/md2html.sh @@ -86,9 +86,7 @@ in { }; }; - services.caddy.virtualHosts."git.ganymede".extraConfig = '' - tls internal - + services.caddy.virtualHosts."git.collin.williamsfam.us.com".extraConfig = '' @assets path /cgit.css /cgit.js /favicon.svg /robots.txt handle @assets { root * ${custom_cgit} -- cgit v1.3.1