$subj = PublicInbox::Hval->new_oneline($subj)->as_html;
my $more = 'permalink';
my $root_anchor = $state->{root_anchor};
- my $path = $root_anchor ? '../' : '';
+ my $path = $root_anchor ? '../../' : '';
my $href = $mid->as_href;
my $irt = $header_obj->header('In-Reply-To');
my ($anchor_idx, $anchor, $t_anchor);
$t_anchor = '';
}
if ($srch) {
- $subj = "<a\nhref=\"${path}t/$href.html#u\">$subj</a>";
+ $subj = "<a\nhref=\"${path}t/$href/#u\">$subj</a>";
}
if ($root_anchor && $root_anchor eq $id) {
$subj = "<u\nid=\"u\">$subj</u>";
$fh->write($rv .= "\n\n");
my ($fhref, $more_ref);
- my $mhref = "${path}m/$href.html";
+ my $mhref = "${path}m/$href/";
if ($level > 0) {
- $fhref = "${path}f/$href.html";
+ $fhref = "${path}f/$href/";
$more_ref = \$more;
}
# scan through all parts, looking for displayable text
});
$mime->body_set('');
- my $txt = "${path}m/$href.txt";
+ my $txt = "${path}m/$href/raw";
$rv = "\n<a\nhref=\"$mhref\">$more</a> <a\nhref=\"$txt\">raw</a> ";
$rv .= html_footer($mime, 0, undef, $ctx);
unless (defined $anchor) {
my $v = PublicInbox::Hval->new_msgid($irt);
$v = $v->as_href;
- $anchor = "${path}m/$v.html";
+ $anchor = "${path}m/$v/";
$seen->{$anchor_idx} = $anchor;
}
$rv .= " <a\nhref=\"$anchor\">parent</a>";
}
if ($srch) {
- $rv .= " <a\nhref=\"${path}t/$href.html$t_anchor\">" .
+ $rv .= " <a\nhref=\"${path}t/$href/$t_anchor\">" .
"threadlink</a>";
}
my $final_anchor = $state->{anchor_idx};
my $next = "<a\nid=\"s$final_anchor\">";
$next .= $final_anchor == 1 ? 'only message in' : 'end of';
- $next .= " thread</a>, back to <a\nhref=\"../\">index</a>\n";
- $mid = PublicInbox::Hval->new_msgid($mid)->as_href;
- $next .= "download: <a\nhref=\"$mid.mbox.gz\">mbox.gz</a>\n\n";
+ $next .= " thread</a>, back to <a\nhref=\"../../\">index</a>\n";
+ # $mid = PublicInbox::Hval->new_msgid($mid)->as_href;
+ $next .= "download: <a\nhref=\"mbox.gz\">mbox.gz</a>\n\n";
$fh->write("<hr />" . PRE_WRAP . $next . $foot .
"</pre></body></html>");
$fh->close;
} elsif ($h eq 'Subject') {
$title[0] = $v->as_html;
if ($srch) {
- $rv .= "$h: <a\nhref=\"../t/$mid_href.html\">";
+ $rv .= "$h: <a\nhref=\"../../t/$mid_href/\">";
$rv .= $v->as_html . "</a>\n";
next;
}
}
$rv .= 'Message-ID: <' . $mid->as_html . '> ';
- $mid_href = "../m/$mid_href" unless $full_pfx;
- $rv .= "(<a\nhref=\"$mid_href.txt\">raw</a>)\n";
+ my $raw_ref = $full_pfx ? 'raw' : "../../m/$mid_href/raw";
+ $rv .= "(<a\nhref=\"$raw_ref\">raw</a>)\n";
my $irt = $header_obj->header('In-Reply-To');
if (defined $irt) {
my $html = $v->as_html;
my $href = $v->as_href;
$rv .= "In-Reply-To: <";
- $rv .= "<a\nhref=\"$href.html\">$html</a>>\n";
+ $rv .= "<a\nhref=\"../$href/\">$html</a>>\n";
}
my $refs = $header_obj->header('References');
my $href = "mailto:$to?In-Reply-To=$irt&Cc=${cc}&Subject=$subj";
my $srch = $ctx->{srch} if $ctx;
- my $idx = $standalone ? " <a\nhref=\"../\">index</a>" : '';
+ my $idx = $standalone ? " <a\nhref=\"../../\">index</a>" : '';
if ($idx && $srch) {
$irt = $mime->header('In-Reply-To') || '';
$mid = mid_compress(mid_clean($mid));
my $t_anchor = length $irt ? T_ANCHOR : '';
- $idx = " <a\nhref=\"../t/$mid.html$t_anchor\">".
+ $idx = " <a\nhref=\"../../t/$mid/$t_anchor\">".
"threadlink</a>$idx";
my $res = $srch->get_followups($mid);
if (my $c = $res->{total}) {
if ($irt) {
$irt = PublicInbox::Hval->new_msgid($irt);
$irt = $irt->as_href;
- $irt = "<a\nhref=\"$irt\">parent</a> ";
+ $irt = "<a\nhref=\"../$irt/\">parent</a> ";
} else {
$irt = ' ' x length('parent ');
}
my $v = PublicInbox::Hval->new_msgid($_[0]);
my $html = $v->as_html;
my $href = $v->as_href;
- "<<a\nhref=\"$href.html\">$html</a>>";
+ "<<a\nhref=\"../$href/\">$html</a>>";
}
sub anchor_for {
my $m = PublicInbox::Hval->new_msgid($mid);
$f = PublicInbox::Hval->new($f);
$d = PublicInbox::Hval->new($d);
- $m = $m->as_href . '.html';
+ $m = $m->as_href . '/';
$f = $f->as_html;
$d = $d->as_html . ' UTC';
if (length($s) == 0) {
my $title = 'Thread does not exist';
$cb->([404, ['Content-Type' => 'text/html']])->write(<<EOF);
<html><head><title>$title</title></head><body><pre>$title
-<a href="../">Return to index</a></pre></body></html>
+<a href="../../">Return to index</a></pre></body></html>
EOF
}