diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-05-24 05:46:54 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-24 05:46:54 (JST) |
commit | bbcdc290c6c0b8121e57dbca4bd66c9e5e729959 (patch) | |
tree | fb762f2153b60cc4f997095626af70baa16ce7b1 /shared.c | |
parent | 25da3f76255754c8b3f98232a5eb84f47088d0f7 (diff) | |
download | cgit-bbcdc290c6c0b8121e57dbca4bd66c9e5e729959.zip cgit-bbcdc290c6c0b8121e57dbca4bd66c9e5e729959.tar.gz |
Add repo.readme parameter
This parameter can be used to specify a repo-specific includefile, which will
then be printed on the summary page for the repo.
If the parametervalue is a not an absolute path, it is taken to be relative
to repo.path.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'shared.c')
-rw-r--r-- | shared.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -107,6 +107,7 @@ struct repoinfo *add_repo(const char *url) | |||
107 | ret->enable_log_filecount = cgit_enable_log_filecount; | 107 | ret->enable_log_filecount = cgit_enable_log_filecount; |
108 | ret->enable_log_linecount = cgit_enable_log_linecount; | 108 | ret->enable_log_linecount = cgit_enable_log_linecount; |
109 | ret->module_link = cgit_module_link; | 109 | ret->module_link = cgit_module_link; |
110 | ret->readme = NULL; | ||
110 | return ret; | 111 | return ret; |
111 | } | 112 | } |
112 | 113 | ||
@@ -187,7 +188,12 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
187 | cgit_repo->enable_log_linecount = cgit_enable_log_linecount * atoi(value); | 188 | cgit_repo->enable_log_linecount = cgit_enable_log_linecount * atoi(value); |
188 | else if (cgit_repo && !strcmp(name, "repo.module-link")) | 189 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
189 | cgit_repo->module_link= xstrdup(value); | 190 | cgit_repo->module_link= xstrdup(value); |
190 | else if (!strcmp(name, "include")) | 191 | else if (cgit_repo && !strcmp(name, "repo.readme") && value != NULL) { |
192 | if (*value == '/') | ||
193 | cgit_repo->readme = xstrdup(value); | ||
194 | else | ||
195 | cgit_repo->readme = xstrdup(fmt("%s/%s", cgit_repo->path, value)); | ||
196 | } else if (!strcmp(name, "include")) | ||
191 | cgit_read_config(value, cgit_global_config_cb); | 197 | cgit_read_config(value, cgit_global_config_cb); |
192 | } | 198 | } |
193 | 199 | ||