From 13e78c0971f7e934c7abc220bcdd22bd01ff2a36 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 14 Aug 2026 11:07:36 -1000 Subject: Modernize the document head --- source/ui-shared.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/ui-shared.c b/source/ui-shared.c index 49c9ef0..b776a60 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -326,7 +326,7 @@ static void print_rel_vcs_link(const char *url) html_attr(url); html("' title='"); html_attr(ctx.repo->name); - html(" Git repository'/>\n"); + html(" Git repository'>\n"); } static int emit_css_link(struct string_list_item *item, void *fallback) @@ -335,7 +335,7 @@ static int emit_css_link(struct string_list_item *item, void *fallback) if (item && *item->string == '\0') return 0; - html("string); else @@ -1143,17 +1143,22 @@ void cgit_print_docstart(void) html("\n"); html("\n"); html("\n"); - html("\n"); - html("\n"); - html("\n"); - html("\n"); - html("\n"); + html("\n"); + html("\n"); + html("\n"); + html("\n"); + html("\n"); html(""); - html_txt(ctx.page.title); + // An error page reached before a title was chosen still has to name + // itself, since an empty title element is not valid. + html_txt(ctx.page.title ? ctx.page.title : ctx.cfg.root_title); html("\n"); - htmlf("\n", cgit_version); - if (ctx.cfg.robots && *ctx.cfg.robots) - htmlf("\n", ctx.cfg.robots); + htmlf("\n", cgit_version); + if (ctx.cfg.robots && *ctx.cfg.robots) { + html("\n"); + } if (ctx.cfg.css.items) for_each_string_list(&ctx.cfg.css, emit_css_link, NULL); @@ -1168,7 +1173,7 @@ void cgit_print_docstart(void) if (ctx.cfg.favicon && *ctx.cfg.favicon) { html("\n"); + html("'>\n"); } if (host && ctx.repo && ctx.qry.head) { char *fileurl; @@ -1181,7 +1186,7 @@ void cgit_print_docstart(void) fileurl = cgit_fileurl(ctx.repo->url, "atom", ctx.qry.vpath, sb.buf); html_attr(fileurl); - html("' type='application/atom+xml'/>\n"); + html("' type='application/atom+xml'>\n"); strbuf_release(&sb); free(fileurl); } -- cgit v2.8.0