From 07a8790205aadc9e301310514f3819e4e904b44f Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 27 Aug 2026 06:07:37 -1000 Subject: Add a meta description to the page head --- source/ui-shared.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index e8eaf4f..cd822a0 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1454,6 +1454,18 @@ void cgit_print_docstart(void) if (ctx.env.authenticated && (pinned = pinned_oid())) html_txtf(" @ %.*s", SHORT_HASH_LEN, oid_to_hex(pinned)); html("\n"); + // The placeholder a scanned repository carries instead of a description + // is left out, since it describes nothing. + if (ctx.repo && ctx.repo->desc && *ctx.repo->desc && + ctx.repo->desc != cgit_default_repo_desc) { + html("\n"); + } else if (!ctx.repo && ctx.cfg.root_desc && *ctx.cfg.root_desc) { + html("\n"); + } htmlf("\n", cgit_version); if (ctx.cfg.robots && *ctx.cfg.robots) { html("