diff options
author | Naïm Favier <fnaim42@gmail.com> | 2019-12-09 18:38:14 +0000 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-12-19 17:02:52 +0000 |
commit | ecd9c584ce5894f4a06d23eec5678a642c2f7020 (patch) | |
tree | bafdc6b4f72be20c28dcbaddc3b9b67061c8c24d /cgit.c | |
parent | 907134b7a29177cb45aa461c549c004b1ae875af (diff) | |
download | cgit-ecd9c584ce5894f4a06d23eec5678a642c2f7020.tar cgit-ecd9c584ce5894f4a06d23eec5678a642c2f7020.tar.gz cgit-ecd9c584ce5894f4a06d23eec5678a642c2f7020.zip |
Make default pages configurablech/default-pages
Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -56,6 +56,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va repo->homepage = xstrdup(value); else if (!strcmp(name, "defbranch")) repo->defbranch = xstrdup(value); + else if (!strcmp(name, "default-page")) + repo->default_page = xstrdup(value); else if (!strcmp(name, "extra-head-content")) repo->extra_head_content = xstrdup(value); else if (!strcmp(name, "snapshots")) @@ -141,6 +143,8 @@ static void config_cb(const char *name, const char *value) ctx.cfg.root_desc = xstrdup(value); else if (!strcmp(name, "root-readme")) ctx.cfg.root_readme = xstrdup(value); + else if (!strcmp(name, "root-default-page")) + ctx.cfg.root_default_page = xstrdup(value); else if (!strcmp(name, "css")) string_list_append(&ctx.cfg.css, xstrdup(value)); else if (!strcmp(name, "js")) @@ -157,6 +161,8 @@ static void config_cb(const char *name, const char *value) ctx.cfg.logo = xstrdup(value); else if (!strcmp(name, "logo-link")) ctx.cfg.logo_link = xstrdup(value); + else if (!strcmp(name, "default-page")) + ctx.cfg.default_page = xstrdup(value); else if (!strcmp(name, "module-link")) ctx.cfg.module_link = xstrdup(value); else if (!strcmp(name, "strict-export")) @@ -380,6 +386,7 @@ static void prepare_context(void) ctx.cfg.case_sensitive_sort = 1; ctx.cfg.branch_sort = 0; ctx.cfg.commit_sort = 0; + ctx.cfg.default_page= "summary"; ctx.cfg.logo = "/cgit.png"; ctx.cfg.favicon = "/favicon.ico"; ctx.cfg.local_time = 0; @@ -400,6 +407,7 @@ static void prepare_context(void) ctx.cfg.robots = "index, nofollow"; ctx.cfg.root_title = "Git repository browser"; ctx.cfg.root_desc = "a fast webinterface for the git dscm"; + ctx.cfg.root_default_page = "repolist"; ctx.cfg.scan_hidden_path = 0; ctx.cfg.script_name = CGIT_SCRIPT_NAME; ctx.cfg.section = ""; @@ -811,6 +819,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo) } if (repo->defbranch) fprintf(f, "repo.defbranch=%s\n", repo->defbranch); + if (repo->default_page) + fprintf(f, "repo.default-page=%s\n", repo->default_page); if (repo->extra_head_content) fprintf(f, "repo.extra-head-content=%s\n", repo->extra_head_content); if (repo->module_link) |