From 16be7b046b8c10cefa3fbc5a1883d73cfc627a01 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 8 May 2026 10:00:20 +0200 Subject: feat: add welcome text to index page via root-readme Inject site-desc.html on the repo list page using cgit's root-readme option. Mirrors the welcome text and signature from the gitweb theme. --- cgit.css | 40 ++++++++++++++++++++++++++++++++++++++++ cgitrc.example | 1 + images/signature.png | Bin 0 -> 9765 bytes site-desc.html | 15 +++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 images/signature.png create mode 100644 site-desc.html diff --git a/cgit.css b/cgit.css index 8f1085c..9114f17 100644 --- a/cgit.css +++ b/cgit.css @@ -351,6 +351,46 @@ div.content { width: 100%; } +/* ============================================================= + SITE DESCRIPTION (index page, root-readme) + ============================================================= */ + +div.site-desc { + max-width: 680px; + margin: 2rem auto 2.5rem; + padding: 0 1rem; + color: var(--text); + font-family: 'IBM Plex Sans', sans-serif; + font-size: 0.95rem; + line-height: 1.7; +} + +div.site-desc h2 { + font-family: 'Oxanium', sans-serif; + font-size: 1.4rem; + color: var(--accent); + margin-bottom: 0.75rem; +} + +div.site-desc a { + color: var(--accent2); + text-decoration: none; +} + +div.site-desc a:hover { + text-decoration: underline; + opacity: 1; +} + +div.site-desc .welcome-close { + color: var(--text-dim); + font-style: italic; +} + +div.site-desc .signature-wrap { + margin-top: 1rem; +} + /* ============================================================= REPO LIST PAGE ============================================================= */ diff --git a/cgitrc.example b/cgitrc.example index fba2002..1a4ae80 100644 --- a/cgitrc.example +++ b/cgitrc.example @@ -13,6 +13,7 @@ logo=/cgit-theme/images/lampD.png logo-link=https://danix.xyz head-include=/var/www/cgit-theme-danix/head.html footer=/usr/share/cgit/cgit-theme-danix/footer.html +root-readme=/var/www/cgit-theme-danix/site-desc.html source-filter=/usr/share/cgit/cgit-theme-danix/syntax-highlight.py # ---- Site settings ---- diff --git a/images/signature.png b/images/signature.png new file mode 100644 index 0000000..47f5fed Binary files /dev/null and b/images/signature.png differ diff --git a/site-desc.html b/site-desc.html new file mode 100644 index 0000000..b833182 --- /dev/null +++ b/site-desc.html @@ -0,0 +1,15 @@ +
+

My work

+

+ Welcome to my git repository. Here's what I've been working on in the past, + today, and what I'll be (probably) working on in the future. +

+

+ Feel free to have a look at the code I've written and don't hesitate to + drop me a few lines if you want to. +

+

I wish you a great day!

+

+ danix's signature +

+
-- cgit v1.2.3