From e6ad894ba53a185fc19f8563e26aff2ac93edd20 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 4 Sep 2025 23:42:18 +0000 Subject: add wiki support to cgit --- ui-shared.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 93ab93c..d3cf24b 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -10,6 +10,7 @@ #include "cgit.h" #include "ui-shared.h" +#include "ui-blob.h" #include "cmd.h" #include "html.h" #include "version.h" @@ -348,6 +349,12 @@ void cgit_tree_link(const char *name, const char *title, const char *class, reporevlink("tree", name, title, class, head, rev, path); } +void cgit_wiki_link(const char *name, const char *title, const char *class, + const char *head, const char *rev, const char *path) +{ + reporevlink("wiki", name, title, class, head, rev, path); +} + void cgit_plain_link(const char *name, const char *title, const char *class, const char *head, const char *rev, const char *path) { @@ -1099,6 +1106,9 @@ void cgit_print_pageheader(void) else cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); + if (cgit_ref_path_exists(".wiki", ctx.qry.head, 0)) + cgit_wiki_link("wiki", NULL, hc("wiki"), ctx.qry.head, + ctx.qry.oid, NULL); cgit_commit_link("commit", NULL, hc("commit"), ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, -- cgit v1.2.3-freya