aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index e795043..cb8a8df 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -39,6 +39,27 @@ void cgit_print_error(char *msg)
39 html_txt(msg); 39 html_txt(msg);
40 html("</div>\n"); 40 html("</div>\n");
41} 41}
42
43char *cgit_repourl(const char *reponame)
44{
45 if (cgit_virtual_root) {
46 return fmt("%s/%s/", cgit_virtual_root, reponame);
47 } else {
48 return fmt("?r=%s", reponame);
49 }
50}
51
52char *cgit_pageurl(const char *reponame, const char *pagename,
53 const char *query)
54{
55 if (cgit_virtual_root) {
56 return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame,
57 pagename, query);
58 } else {
59 return fmt("?r=%s&p=%s&%s", reponame, pagename, query);
60 }
61}
62
42void cgit_print_docstart(char *title, struct cacheitem *item) 63void cgit_print_docstart(char *title, struct cacheitem *item)
43{ 64{
44 html("Content-Type: text/html; charset=utf-8\n"); 65 html("Content-Type: text/html; charset=utf-8\n");