summaryrefslogtreecommitdiff
path: root/cgit.c
diff options
context:
space:
mode:
authorMehmet Samet Duman <froster12@naver.com>2026-02-13 15:16:12 +0300
committerMehmet Samet Duman <froster12@naver.com>2026-02-13 15:16:12 +0300
commit4ce807b14cde82df10e0c63220a5b1b73610d7d2 (patch)
tree3e7192807778d06fe987e9eb40486f7555251ddb /cgit.c
parentbcd195b23999d238298140a2e76d5e3062d17b38 (diff)
downloadProject-Tick-4ce807b14cde82df10e0c63220a5b1b73610d7d2.tar.gz
Project-Tick-4ce807b14cde82df10e0c63220a5b1b73610d7d2.zip
feat: add support for multiple root external links configuration
Signed-off-by: Mehmet Samet Duman <froster12@naver.com>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 4479adcb78..feaa8b6803 100644
--- a/cgit.c
+++ b/cgit.c
@@ -40,6 +40,26 @@ static void add_mimetype(const char *name, const char *value)
item->util = xstrdup(value);
}
+static void add_root_link(const char *value)
+{
+ const char *sep;
+ struct string_list_item *item;
+
+ if (!value || !value[0])
+ return;
+
+ sep = strchr(value, '|');
+ if (sep && sep > value && sep[1]) {
+ item = string_list_append(&ctx.cfg.root_links,
+ xstrndup(value, sep - value));
+ item->util = xstrdup(sep + 1);
+ return;
+ }
+
+ item = string_list_append(&ctx.cfg.root_links, xstrdup(value));
+ item->util = xstrdup(value);
+}
+
static void process_cached_repolist(const char *path);
static void repo_config(struct cgit_repo *repo, const char *name, const char *value)
@@ -167,6 +187,8 @@ static void config_cb(const char *name, const char *value)
ctx.cfg.root_homepage = xstrdup(value);
else if (!strcmp(name, "root-homepage-title"))
ctx.cfg.root_homepage_title = xstrdup(value);
+ else if (!strcmp(name, "root-link"))
+ add_root_link(value);
else if (!strcmp(name, "css"))
string_list_append(&ctx.cfg.css, xstrdup(value));
else if (!strcmp(name, "js"))