* Fix bestlink to use pagecase for pages in userdir, to support pages
authorjoshtriplett <joshtriplett@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 27 Apr 2007 09:11:14 +0000 (09:11 +0000)
committerjoshtriplett <joshtriplett@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 27 Apr 2007 09:11:14 +0000 (09:11 +0000)
  with non-lowercase filenames.

IkiWiki.pm
debian/changelog

index 73280abf1b13b0f3d56e3c71657ac401da061cc6..212b0de08e050eded0c1e42af53a03dd4250d2a9 100644 (file)
@@ -362,8 +362,14 @@ sub bestlink ($$) { #{{{
                }
        } while $cwd=~s!/?[^/]+$!!;
 
-       if (length $config{userdir} && exists $links{"$config{userdir}/".lc($link)}) {
-               return "$config{userdir}/".lc($link);
+       if (length $config{userdir}) {
+               my $l = "$config{userdir}/".lc($link);
+               if (exists $links{$l}) {
+                       return $l;
+               }
+               elsif (exists $pagecase{lc $l}) {
+                       return $pagecase{lc $l};
+               }
        }
 
        #print STDERR "warning: page $page, broken link: $link\n";
index 867934f24643a2a58b550a6f9d80da9e0c4a9514..b634bea3b17416825b52c583742e00358988623c 100644 (file)
@@ -35,7 +35,11 @@ ikiwiki (1.51) UNRELEASED; urgency=low
   * Add testpagespec plugin, which might be useful to see why a pagespec isn't
     working as desired.
 
- -- Joey Hess <joeyh@debian.org>  Fri, 27 Apr 2007 03:41:52 -0400
+  [ Josh Triplett ]
+  * Fix bestlink to use pagecase for pages in userdir, to support pages
+    with non-lowercase filenames.
+
+ -- Josh Triplett <josh@freedesktop.org>  Fri, 27 Apr 2007 02:08:58 -0700
 
 ikiwiki (1.50) unstable; urgency=low