projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a1997e1
)
add navbar
author
joey
<joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 10 Mar 2006 02:38:16 +0000
(
02:38
+0000)
committer
joey
<joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 10 Mar 2006 02:38:16 +0000
(
02:38
+0000)
ikiwiki
patch
|
blob
|
history
diff --git
a/ikiwiki
b/ikiwiki
index 4d736c6134a9e0a6516ead060402ef79474e9666..eba94cba247190d0fae6c2b93d67f8cb97e80925 100755
(executable)
--- a/
ikiwiki
+++ b/
ikiwiki
@@
-18,6
+18,7
@@
my ($srcdir)= shift =~ /(.*)/; # untaint
my ($destdir)= shift =~ /(.*)/; # untaint
my $link=qr/\[\[([^\s]+)\]\]/;
my $verbose=1;
my ($destdir)= shift =~ /(.*)/; # untaint
my $link=qr/\[\[([^\s]+)\]\]/;
my $verbose=1;
+my $wikiname="wiki";
my %links;
my %oldpagemtime;
my %links;
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) {
$bestlink=htmlpage($bestlink);
if (! grep { $_ eq $bestlink } values %renderedfiles) {
$bestlink=htmlpage($bestlink);
@@
-198,9
+199,24
@@
sub finalize ($$) {
my $title=basename($page);
$title=~s/_/ /g;
my $title=basename($page);
$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".
- $content.
- "</body>\n</html>\n";
+ "<h1>$pagelink</h1>\n".
+ $content.
+ "</body>\n</html>\n";
return $content;
}
return $content;
}