From e582151a5e10ecaf0feffd4fe0941b075e2c9ede Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:26:51 -0700 Subject: Write the meta description in one place --- source/ui-shared.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/ui-shared.c b/source/ui-shared.c index eb57497..6858a1c 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1397,6 +1397,7 @@ void cgit_print_docstart(void) { const struct object_id *pinned; struct string_list_item *item; + const char *desc; char *host; if (ctx.cfg.embedded) { @@ -1424,13 +1425,10 @@ void cgit_print_docstart(void) 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) { + desc = ctx.repo ? ctx.repo->desc : ctx.cfg.root_desc; + if (desc && *desc && desc != cgit_default_repo_desc) { html("\n"); - } else if (!ctx.repo && ctx.cfg.root_desc && *ctx.cfg.root_desc) { - html("\n"); } if (ctx.cfg.enable_version_info) -- cgit