add navbar
parent
a1997e1994
commit
b4a6a97534
18
ikiwiki
18
ikiwiki
|
@ -18,6 +18,7 @@ my ($srcdir)= shift =~ /(.*)/; # untaint
|
||||||
my ($destdir)= shift =~ /(.*)/; # untaint
|
my ($destdir)= shift =~ /(.*)/; # untaint
|
||||||
my $link=qr/\[\[([^\s]+)\]\]/;
|
my $link=qr/\[\[([^\s]+)\]\]/;
|
||||||
my $verbose=1;
|
my $verbose=1;
|
||||||
|
my $wikiname="wiki";
|
||||||
|
|
||||||
my %links;
|
my %links;
|
||||||
my %oldpagemtime;
|
my %oldpagemtime;
|
||||||
|
@ -153,7 +154,7 @@ sub htmllink ($$) {
|
||||||
|
|
||||||
my $bestlink=bestlink($page, $link);
|
my $bestlink=bestlink($page, $link);
|
||||||
|
|
||||||
return $page if $page eq $bestlink;
|
return $link if $page eq $bestlink;
|
||||||
|
|
||||||
if (! grep { $_ eq $bestlink } values %renderedfiles) {
|
if (! grep { $_ eq $bestlink } values %renderedfiles) {
|
||||||
$bestlink=htmlpage($bestlink);
|
$bestlink=htmlpage($bestlink);
|
||||||
|
@ -198,7 +199,22 @@ sub finalize ($$) {
|
||||||
my $title=basename($page);
|
my $title=basename($page);
|
||||||
$title=~s/_/ /g;
|
$title=~s/_/ /g;
|
||||||
|
|
||||||
|
my $pagelink="";
|
||||||
|
my $path="";
|
||||||
|
foreach my $dir (reverse split("/", $page)) {
|
||||||
|
if (length($pagelink)) {
|
||||||
|
$pagelink="<a href=\"$path$dir.html\">$dir/</a> $pagelink";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$pagelink=$dir;
|
||||||
|
}
|
||||||
|
$path.="../";
|
||||||
|
}
|
||||||
|
$path=~s/\.\.\///;
|
||||||
|
$pagelink="<a href=\"$path\">$wikiname/</a> $pagelink";
|
||||||
|
|
||||||
$content="<html>\n<head><title>$title</title></head>\n<body>\n".
|
$content="<html>\n<head><title>$title</title></head>\n<body>\n".
|
||||||
|
"<h1>$pagelink</h1>\n".
|
||||||
$content.
|
$content.
|
||||||
"</body>\n</html>\n";
|
"</body>\n</html>\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue