- my $urls = 'Archives are clonable:';
- my $ibx = $ctx->{-inbox};
- my $desc = ascii_html($ibx->description);
-
- my @urls;
- my $http = $ctx->{base_url};
- my $max = $ibx->max_git_epoch;
- my $dir = (split(m!/!, $http))[-1];
- my %seen = ($http => 1);
- if (defined($max)) { # v2
- for my $i (0..$max) {
- # old parts my be deleted:
- -d "$ibx->{inboxdir}/git/$i.git" or next;
- my $url = "$http/$i";
- $seen{$url} = 1;
- push @urls, "$url $dir/git/$i.git";
+ my $upfx = $ctx->{-upfx} || '';
+ my $m = "${upfx}_/text/mirror/";
+ my $x;
+ if ($ctx->{ibx}->can('cloneurl')) {
+ $x = <<EOF;
+This is a public inbox, see <a
+href="$m">mirroring instructions</a>
+for how to clone and mirror all data and code used for this inbox
+EOF
+ my $has_nntp = @{$ctx->{ibx}->nntp_url($ctx)};
+ my $has_imap = @{$ctx->{ibx}->imap_url($ctx)};
+ if ($has_nntp || $has_imap) {
+ substr($x, -1, 1) = ";\n"; # s/\n/;\n
+ if ($has_nntp && $has_imap) {
+ $x .= <<EOM;
+as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).
+EOM
+ } elsif ($has_nntp) {
+ $x .= <<EOM;
+as well as URLs for NNTP newsgroup(s).
+EOM
+ } else {
+ $x .= <<EOM;
+as well as URLs for IMAP folder(s).
+EOM
+ }