From: andy at warmcat.com (Andy Green)
Subject: [PATCH 1/2] config: add root-desc-html and repo.desc-html
Date: Thu, 21 Jun 2018 14:46:28 +0800 [thread overview]
Message-ID: <152956358883.741.17751697642155677046.stgit@mail.warmcat.com> (raw)
In-Reply-To: <45190b3f-ced1-2b5f-9d3e-c9da90192867@warmcat.com>
These are optional, default-empty raw html strings that
are emitted after the corresponding text-only versions
root-desc and repo.desc when they are used in the header
area.
This provides a flexible way to place buttons or links
in the header region for both the repo index page and
for repos individually.
The existing root-desc and repo.desc keep their original
meaning as a shortish text-only repo description.
Signed-off-by: Andy Green <andy at warmcat.com>
---
cgit.c | 4 ++++
cgit.h | 2 ++
cgitrc.5.txt | 8 ++++++++
3 files changed, 14 insertions(+)
diff --git a/cgit.c b/cgit.c
index bdb2fad..1b819e7 100644
--- a/cgit.c
+++ b/cgit.c
@@ -52,6 +52,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
repo->clone_url = xstrdup(value);
else if (!strcmp(name, "desc"))
repo->desc = xstrdup(value);
+ else if (!strcmp(name, "desc-html"))
+ repo->desc_html = xstrdup(value);
else if (!strcmp(name, "owner"))
repo->owner = xstrdup(value);
else if (!strcmp(name, "homepage"))
@@ -142,6 +144,8 @@ static void config_cb(const char *name, const char *value)
ctx.cfg.root_title = xstrdup(value);
else if (!strcmp(name, "root-desc"))
ctx.cfg.root_desc = xstrdup(value);
+ else if (!strcmp(name, "root-desc-html"))
+ ctx.cfg.root_desc_html = xstrdup(value);
else if (!strcmp(name, "root-readme"))
ctx.cfg.root_readme = xstrdup(value);
else if (!strcmp(name, "css"))
diff --git a/cgit.h b/cgit.h
index 99ea7a2..1094062 100644
--- a/cgit.h
+++ b/cgit.h
@@ -81,6 +81,7 @@ struct cgit_repo {
char *name;
char *path;
char *desc;
+ char *desc_html;
char *owner;
char *homepage;
char *defbranch;
@@ -207,6 +208,7 @@ struct cgit_config {
char *robots;
char *root_title;
char *root_desc;
+ char *root_desc_html;
char *root_readme;
char *script_name;
char *section;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 99fc799..4ddb51e 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -378,6 +378,10 @@ root-desc::
Text printed below the heading on the repository index page. Default
value: "a fast webinterface for the git dscm".
+root-desc-html::
+ Optional additional raw html to show in the header after root-desc.
+ Default value: none.
+
root-readme::
The content of the file specified with this option will be included
verbatim below the "about" link on the repository index page. Default
@@ -503,6 +507,10 @@ repo.defbranch::
repo.desc::
The value to show as repository description. Default value: none.
+repo.desc-html::
+ Optional additional raw html to show in the header after repo.desc.
+ Default value: none.
+
repo.email-filter::
Override the default email-filter. Default value: none. See also:
"enable-filter-overrides". See also: "FILTER API".
next prev parent reply other threads:[~2018-06-21 6:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 9:04 repo.desc as raw html? andy
2018-06-20 13:17 ` [PATCH] noheader: place branch combo on tabs if no header andy
2018-06-23 10:50 ` john
2018-06-21 6:46 ` andy [this message]
2018-06-21 6:46 ` [PATCH 2/2] ui-shared: emit root-desc-html and repo.desc-html after their text counterparts andy
2018-06-23 10:28 ` john
2018-06-23 10:33 ` andy
2018-06-23 10:53 ` john
2018-06-23 11:08 ` andy
2018-06-23 16:33 ` john
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=152956358883.741.17751697642155677046.stgit@mail.warmcat.com \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).