From: joey Date: Fri, 10 Mar 2006 02:38:16 +0000 (+0000) Subject: add navbar X-Git-Tag: 1.0~562 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b4a6a97534a9d956844ce112c2d3277c1f8104ae;p=ikiwiki.git add navbar --- diff --git a/ikiwiki b/ikiwiki index 4d736c613..eba94cba2 100755 --- a/ikiwiki +++ b/ikiwiki @@ -18,6 +18,7 @@ my ($srcdir)= shift =~ /(.*)/; # untaint my ($destdir)= shift =~ /(.*)/; # untaint my $link=qr/\[\[([^\s]+)\]\]/; my $verbose=1; +my $wikiname="wiki"; my %links; my %oldpagemtime; @@ -153,7 +154,7 @@ sub htmllink ($$) { my $bestlink=bestlink($page, $link); - return $page if $page eq $bestlink; + return $link if $page eq $bestlink; if (! grep { $_ eq $bestlink } values %renderedfiles) { $bestlink=htmlpage($bestlink); @@ -198,9 +199,24 @@ sub finalize ($$) { my $title=basename($page); $title=~s/_/ /g; + my $pagelink=""; + my $path=""; + foreach my $dir (reverse split("/", $page)) { + if (length($pagelink)) { + $pagelink="$dir/ $pagelink"; + } + else { + $pagelink=$dir; + } + $path.="../"; + } + $path=~s/\.\.\///; + $pagelink="$wikiname/ $pagelink"; + $content="\n$title\n\n". - $content. - "\n\n"; + "

$pagelink

\n". + $content. + "\n\n"; return $content; }