[PATCH 1/5] ui-shared: add viewport tag for baseline mobile usability

Rito Rhymes rito at ritovision.com
Wed Feb 25 23:07:25 UTC 2026


Set the viewport so mobile browsers render at device width by default,
instead of using a desktop-width initial layout.

This is the first essential step in preventing the "panzoom dance" of
pinch-zooming and panning just to read content. This is the baseline
needed for mobile CSS fixes in follow-up commits.

It does not fully fix mobile layout issues on its own; follow-up CSS
patches address remaining overflow and scrolling issues.

Signed-off-by: Rito Rhymes <rito at ritovision.com>
---
 ui-shared.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui-shared.c b/ui-shared.c
index 6fae72d..af1ca16 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -821,6 +821,7 @@ void cgit_print_docstart(void)
 	htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
 	if (ctx.cfg.robots && *ctx.cfg.robots)
 		htmlf("<meta name='robots' content='%s'/>\n", ctx.cfg.robots);
+	html("<meta name='viewport' content='width=device-width, initial-scale=1'/>\n");
 
 	if (ctx.cfg.css.items)
 		for_each_string_list(&ctx.cfg.css, emit_css_link, NULL);
-- 
2.51.0



More information about the CGit mailing list