From e8671e5f11c1d64d539cf4677808e7617c94d050 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:36:07 -1000 Subject: Hand the about filter the tree url its links need With nothing below the about page, a readme's relative links have to be written against the tree, and only cgit knows how this site spells the url of a tree page and which ref the readme was read from. Both reach the filter already escaped for a url, built by the same writer as cgit's own links. --- source/ui-shared.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/ui-shared.h') diff --git a/source/ui-shared.h b/source/ui-shared.h index 93cc9d2..dd90196 100644 --- a/source/ui-shared.h +++ b/source/ui-shared.h @@ -31,6 +31,14 @@ extern char *cgit_fileurl(const char *reponame, const char *pagename, const char const char *query); extern char *cgit_pageurl(const char *reponame, const char *pagename, const char *query); +/* + * The url of the current repository's tree page at head, split where a path + * in the tree goes, for a filter to build links of its own from. Both parts + * are escaped for a url but not for HTML, and query stays empty for the + * default branch. + */ +extern void cgit_tree_url(const char *head, struct strbuf *base, struct strbuf *query); + /* * Call fn once for every URL this repository can be cloned from. */ -- cgit