List for cgit developers and users
 help / color / mirror / Atom feed
From: b.laessig at pengutronix.de (b.laessig at pengutronix.de)
Subject: [PATCH] expand environmentvariables in root-title and root-descr
Date: Thu, 12 Apr 2018 11:19:12 +0200	[thread overview]
Message-ID: <20180412091912.11486-1-b.laessig@pengutronix.de> (raw)

From: Bj?rn L?ssig <b.laessig at pengutronix.de>

For having personanlized cgit configuration i need to use

  root-desc=$REMOTE_USER@$HTTP_HOST
---
 cgit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cgit.c b/cgit.c
index bd9cb3f..1d7d67e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -120,9 +120,9 @@ static void config_cb(const char *name, const char *value)
 	else if (!strcmp(name, "readme"))
 		string_list_append(&ctx.cfg.readme, xstrdup(value));
 	else if (!strcmp(name, "root-title"))
-		ctx.cfg.root_title = xstrdup(value);
+		ctx.cfg.root_title = xstrdup(expand_macros(value));
 	else if (!strcmp(name, "root-desc"))
-		ctx.cfg.root_desc = xstrdup(value);
+		ctx.cfg.root_desc = xstrdup(expand_macros(value));
 	else if (!strcmp(name, "root-readme"))
 		ctx.cfg.root_readme = xstrdup(value);
 	else if (!strcmp(name, "css"))
-- 
2.11.0



             reply	other threads:[~2018-04-12  9:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  9:19 b.laessig [this message]
2018-06-16 16:25 ` john
2018-06-18  6:36   ` 
2022-07-11 14:57   ` Björn Lässig

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=20180412091912.11486-1-b.laessig@pengutronix.de \
    --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).