diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-08-26 13:01:33 -0500 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-08-26 13:03:27 -0500 |
| commit | 53c787c651df22bf0d8c5e2c7117143f8a0e2359 (patch) | |
| tree | 98d15a9373a69cb12f3374c4246c5cccb3821209 /modules/services/nixos/cgit/cgit-head.html | |
| parent | a7b13cd858d9fbd6592323984d55bd57beacee46 (diff) | |
small changes to cgit
Diffstat (limited to 'modules/services/nixos/cgit/cgit-head.html')
| -rw-r--r-- | modules/services/nixos/cgit/cgit-head.html | 19 |
1 files changed, 11 insertions, 8 deletions
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); - }); + }); </script> |
