X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=blobdiff_plain;f=ikiwiki;h=53a86c1edc3ef5f3d4498fa2a55d559e8887df3a;hp=d6057c101278d3bfb9dae3b52119bb99dc6bf672;hb=7f8efe4524fb8cc2066e07c4f9fbad3b14fbccfb;hpb=2885278ebd2e2bfad188a583d7ad5d3c8b7c3a21
diff --git a/ikiwiki b/ikiwiki
index d6057c101..53a86c1ed 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -210,9 +210,15 @@ sub htmllink { #{{{
my $page=shift;
my $link=shift;
my $noimageinline=shift; # don't turn links into inline html images
- my $createsubpage=shift; # force creation of a subpage if page DNE
+ my $forcesubpage=shift; # force a link to a subpage
- my $bestlink=bestlink($page, $link);
+ my $bestlink;
+ if (! $forcesubpage) {
+ $bestlink=bestlink($page, $link);
+ }
+ else {
+ $bestlink="$page/".lc($link);
+ }
return $link if length $bestlink && $page eq $bestlink;
@@ -224,12 +230,7 @@ sub htmllink { #{{{
$bestlink=htmlpage($bestlink);
}
if (! grep { $_ eq $bestlink } values %renderedfiles) {
- if (! $createsubpage) {
- return "?$link"
- }
- else {
- return "?$link"
- }
+ return "?$link"
}
$bestlink=File::Spec->abs2rel($bestlink, dirname($page));