Diff options
Diffstat (limited to 'source')
-rw-r--r--source/ui-shared.c10
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("</title>\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("<meta name='description' content='");
- html_attr(ctx.repo->desc);
- html("'>\n");
- } else if (!ctx.repo && ctx.cfg.root_desc && *ctx.cfg.root_desc) {
- html("<meta name='description' content='");
- html_attr(ctx.cfg.root_desc);
+ html_attr(desc);
html("'>\n");
}
if (ctx.cfg.enable_version_info)