From: Eric Wong Date: Fri, 18 Dec 2020 20:53:09 +0000 (+0000) Subject: wwwstream: linkify coderepo URLs X-Git-Tag: v1.7.0~1530 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=f1f61f2e7ab16fdf4441e12b4c3cfb98d7e3e3c5 wwwstream: linkify coderepo URLs It seems like a good idea to get more cgit visibility. --- diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index 66e34a12..49940262 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -78,22 +78,20 @@ sub html_top ($) { sub coderepos ($) { my ($ctx) = @_; - my $ibx = $ctx->{ibx}; + my $cr = $ctx->{ibx}->{coderepo} // return (); + my $cfg = $ctx->{www}->{pi_cfg}; my @ret; - if (defined(my $cr = $ibx->{coderepo})) { - my $cfg = $ctx->{www}->{pi_cfg}; - my $env = $ctx->{env}; - for my $cr_name (@$cr) { - my $urls = $cfg->{"coderepo.$cr_name.cgiturl"}; - if ($urls) { - $ret[0] //= <{"coderepo.$cr_name.cgiturl"} // next; + $ret[0] //= <{env}, $u)); + $ret[0] .= qq(\n\t$u); } } - @ret; # may be empty + @ret; # may be empty, this sub is called as an arg for join() } sub code_footer ($) {