summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2007-05-23 20:46:54 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-05-23 20:46:54 (UTC)
commitbbcdc290c6c0b8121e57dbca4bd66c9e5e729959 (patch) (unidiff)
treefb762f2153b60cc4f997095626af70baa16ce7b1
parent25da3f76255754c8b3f98232a5eb84f47088d0f7 (diff)
downloadcgit-bbcdc290c6c0b8121e57dbca4bd66c9e5e729959.zip
cgit-bbcdc290c6c0b8121e57dbca4bd66c9e5e729959.tar.gz
cgit-bbcdc290c6c0b8121e57dbca4bd66c9e5e729959.tar.bz2
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 (more/less context) (show whitespace changes)
-rw-r--r--cgit.css14
-rw-r--r--cgit.h1
-rw-r--r--cgitrc1
-rw-r--r--shared.c8
-rw-r--r--ui-summary.c14
5 files changed, 23 insertions, 15 deletions
diff --git a/cgit.css b/cgit.css
index 327eaba..8977533 100644
--- a/cgit.css
+++ b/cgit.css
@@ -142,12 +142,8 @@ td#search input {
142 142
143td#summary { 143div#summary {
144 vertical-align: top; 144 vertical-align: top;
145 padding-bottom: 1em; 145 margin-bottom: 1em;
146} 146}
147 147
148td#archivelist { 148table#downloads {
149 padding-bottom: 1em;
150}
151
152td#archivelist table {
153 float: right; 149 float: right;
@@ -155,5 +151,7 @@ td#archivelist table {
155 border: solid 1px #777; 151 border: solid 1px #777;
152 margin-left: 0.5em;
153 margin-bottom: 0.5em;
156} 154}
157 155
158td#archivelist table th { 156table#downloads th {
159 background-color: #ccc; 157 background-color: #ccc;
diff --git a/cgit.h b/cgit.h
index 3938633..5c55bec 100644
--- a/cgit.h
+++ b/cgit.h
@@ -70,2 +70,3 @@ struct repoinfo {
70 char *module_link; 70 char *module_link;
71 char *readme;
71 int snapshots; 72 int snapshots;
diff --git a/cgitrc b/cgitrc
index eaa9ce3..054a708 100644
--- a/cgitrc
+++ b/cgitrc
@@ -110 +110,2 @@
110 #repo.module-link=/git/%s/commit/?id=%s # override the standard module-link 110 #repo.module-link=/git/%s/commit/?id=%s # override the standard module-link
111 #repo.readme=info/web/readme # specify a file to include on summary page
diff --git a/shared.c b/shared.c
index ce3ca4f..e3123a8 100644
--- a/shared.c
+++ b/shared.c
@@ -109,2 +109,3 @@ struct repoinfo *add_repo(const char *url)
109 ret->module_link = cgit_module_link; 109 ret->module_link = cgit_module_link;
110 ret->readme = NULL;
110 return ret; 111 return ret;
@@ -189,3 +190,8 @@ void cgit_global_config_cb(const char *name, const char *value)
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);
diff --git a/ui-summary.c b/ui-summary.c
index 5799773..5c1fc33 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -155,3 +155,3 @@ static int cgit_print_archive_cb(const char *refname, const unsigned char *sha1,
155 if (!header) { 155 if (!header) {
156 html("<table>"); 156 html("<table id='downloads'>");
157 html("<tr><th>Downloads</th></tr>"); 157 html("<tr><th>Downloads</th></tr>");
@@ -195,4 +195,4 @@ void cgit_print_summary()
195{ 195{
196 html("<table class='list nowrap'>"); 196 html("<div id='summary'>");
197 html("<tr class='nohover'><td id='summary' colspan='3'>"); 197 cgit_print_archives();
198 html("<h2>"); 198 html("<h2>");
@@ -202,5 +202,7 @@ void cgit_print_summary()
202 html("</h2>"); 202 html("</h2>");
203 html("</td><td id='archivelist'>"); 203 if (cgit_repo->readme)
204 cgit_print_archives(); 204 html_include(cgit_repo->readme);
205 html("</td></tr>"); 205 html("</div>");
206
207 html("<table class='list nowrap'>");
206 cgit_print_branches(); 208 cgit_print_branches();