summaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-04-01 19:59:42 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-04-01 19:59:42 +0000
commit02b9f69ba5da59cca9ff198b731d63d643fff4db (patch)
tree12d42bdb28dae5c2e8ed5dc5a3a3e3ceb74df0a4 /IkiWiki/Render.pm
parent1087e234f067fd888bff063563ee5c53ef038d82 (diff)
* Finally apply the index.html patch, with thanks to everyone who worked
on and supported creating it (especially Tumov). This adds a "usedirs" option that makes ikiwiki use foo/index.html instead of foo.html as output page names. It is not yet enabled by default.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r--IkiWiki/Render.pm20
1 files changed, 8 insertions, 12 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 7fd7daf11..b65d200a0 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -31,8 +31,8 @@ sub backlinks ($) { #{{{
my @links;
foreach my $p (keys %{$backlinks{$page}}) {
- my $href=abs2rel(htmlpage($p), dirname($page));
-
+ my $href=urlto($p, $page);
+
# Trim common dir prefixes from both pages.
my $p_trimmed=$p;
my $page_trimmed=$page;
@@ -57,18 +57,14 @@ sub parentlinks ($) { #{{{
my @ret;
my $pagelink="";
my $path="";
- my $skip=1;
+ my $title=$config{wikiname};
+
return if $page eq 'index'; # toplevel
- foreach my $dir (reverse split("/", $page)) {
- if (! $skip) {
- $path.="../";
- unshift @ret, { url => $path.htmlpage($dir), page => pagetitle($dir) };
- }
- else {
- $skip=0;
- }
+ foreach my $dir (split("/", $page)) {
+ push @ret, { url => urlto($path, $page), page => $title };
+ $path.="/".$dir;
+ $title=pagetitle($dir);
}
- unshift @ret, { url => length $path ? $path : ".", page => $config{wikiname} };
return @ret;
} #}}}