about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-18 20:53:09 +0000
committerEric Wong <e@80x24.org>2020-12-20 20:38:47 +0000
commitf1f61f2e7ab16fdf4441e12b4c3cfb98d7e3e3c5 (patch)
tree31553c1f875c94f9cee0e26bd9fa6080b463731b
parent8f4253f567852ef56e3a484c9881d4f113e5dc89 (diff)
downloadpublic-inbox-f1f61f2e7ab16fdf4441e12b4c3cfb98d7e3e3c5.tar.gz
It seems like a good idea to get more cgit visibility.
-rw-r--r--lib/PublicInbox/WwwStream.pm20
1 files changed, 9 insertions, 11 deletions
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] //= <<EOF;
+        for my $cr_name (@$cr) {
+                my $urls = $cfg->{"coderepo.$cr_name.cgiturl"} // next;
+                $ret[0] //= <<EOF;
 code repositories for the project(s) associated with this inbox:
 EOF
-                                $ret[0] .= "\n\t".prurl($env, $_) for @$urls;
-                        }
+                for my $u (@$urls) {
+                        $u = ascii_html(prurl($ctx->{env}, $u));
+                        $ret[0] .= qq(\n\t<a\nhref="$u">$u</a>);
                 }
         }
-        @ret; # may be empty
+        @ret; # may be empty, this sub is called as an arg for join()
 }
 
 sub code_footer ($) {