code repositories for project(s) associated with this inbox:
+EOF
+ 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)];
+ }
}
- my $url = PublicInbox::Hval::prurl($ctx->{env}, PI_URL);
- ''.join("\n",
- '- ' . $desc,
- $urls,
- 'Archived served using code from public-inbox:',
- qq(\tgit clone $url public-inbox),
- ).'
';
+ @ret; # may be empty, this sub is called as an arg for join()
}
-sub getline {
- my ($self) = @_;
- my $nr = $self->{nr}++;
-
- return _html_top($self) if $nr == 0;
+sub _html_end {
+ my ($ctx) = @_;
+ my @cr = coderepos($ctx);
+ scalar(@cr) ?
+ '
'.join("\n\n", @cr).'