From d2cc2e6d833fbb63076ef81a3f3dc05244f07aff Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:28:44 -0700 Subject: Keep the clone row and title docs in the header --- source/ui-shared.c | 10 ---------- source/ui-shared.h | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/ui-shared.c b/source/ui-shared.c index 7049f70..b2a09ff 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1575,12 +1575,6 @@ static void capture_http_clone_url(const char *url) http_clone_url = xstrdup(url); } -/* - * One row of the clone table. Every row is a link, but a browser cannot - * follow the ssh, scp or git forms, so those rows point at the first http - * url in the clone list, or at the repository's own page when the list has - * none. A colspan of zero leaves the attribute out. - */ void cgit_print_clone_row(const char *url, int colspan) { const char *href = url; @@ -1857,10 +1851,6 @@ void cgit_set_title_from_path(const char *path) ctx.page.title = strbuf_detach(&sb, NULL); } -/* - * Names the page ahead of the repository and the site, so that the pages of one - * repository can be told apart in tabs, history and search results. - */ void cgit_prefix_title(const char *name) { ctx.page.title = cgit_fmtalloc("%s - %s", name, diff --git a/source/ui-shared.h b/source/ui-shared.h index 7473ef3..a40200e 100644 --- a/source/ui-shared.h +++ b/source/ui-shared.h @@ -10,6 +10,7 @@ #define CGIT_UI_SHARED_H #include "cgit.h" + extern const char *cgit_httpscheme(void); extern char *cgit_hosturl(void); @@ -31,7 +32,6 @@ extern const char *cgit_loginurl(void); * result still needs escaping for wherever it lands. */ extern char *cgit_repourl(const char *reponame); -extern void cgit_print_clone_row(const char *url, int colspan); extern char *cgit_fileurl(const char *reponame, const char *pagename, const char *filename, const char *query); extern char *cgit_pageurl(const char *reponame, const char *pagename, const char *query); @@ -49,6 +49,14 @@ extern void cgit_tree_url(const char *head, struct strbuf *base, struct strbuf * */ extern void cgit_add_clone_urls(void (*fn)(const char *)); +/* + * One row of the clone table. Every row is a link, but a browser cannot + * follow the ssh, scp or git forms, so those rows point at the first http + * url in the clone list, or at the repository's own page when the list has + * none. A colspan of zero leaves the attribute out. + */ +extern void cgit_print_clone_row(const char *url, int colspan); + /* * Each of these writes one anchor to the page and nothing around it, with name * as the text a reader sees. A NULL title or class leaves that attribute out, @@ -139,5 +147,11 @@ extern void cgit_add_hidden_formfields(int incl_head, int incl_search, const cha * Put path in front of the page title, its last component first. */ extern void cgit_set_title_from_path(const char *path); + +/* + * Names the page ahead of the repository and the site, so that the pages of one + * repository can be told apart in tabs, history and search results. + */ extern void cgit_prefix_title(const char *name); + #endif // CGIT_UI_SHARED_H -- cgit 2.11.1