code repositories for project(s) associated with this inbox:
EOF
- } else { # v1
- $urls .= "\n";
+ my $urls = $cfg->get_all("coderepo.$cr_name.cgiturl");
+ if ($urls) {
+ for (@$urls) {
+ # relative or absolute URL?, prefix relative
+ # "foo.git" with appropriate number of "../"
+ my $u = m!\A(?:[a-z\+]+:)?//! ? $_ : $upfx.$_;
+ $u = ascii_html(prurl($ctx->{env}, $u));
+ $ret[0] .= qq(\n\t$u);
+ }
+ } else {
+ $ret[0] .= qq[\n\t$cr_name.git (no URL configured)];
+ }
}
+ @ret; # may be empty, this sub is called as an arg for join()
+}
- my $cfg_link = ($ctx->{-upfx} // '').'_/text/config/raw';
- $urls .= qq(\nExample config snippet for mirrors\n);
- my @nntp = map { qq($_) } @{$ibx->nntp_url};
- if (@nntp) {
- $urls .= "\n";
- $urls .= @nntp == 1 ? 'Newsgroup' : 'Newsgroups are';
- $urls .= ' available over NNTP:';
- $urls .= "\n\t" . join("\n\t", @nntp) . "\n";
- }
- if ($urls =~ m!\b[^:]+://\w+\.onion/!) {
- $urls .= "\n note: .onion URLs require Tor: ";
- $urls .= qq[$TOR_URL];
- }
- '
'.join("\n\n",
- $desc,
- $urls,
- code_footer($ctx->{env})
- ).'