]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/edittemplate.pm
edittemplate: Look for template pages under templates/ like everything else (still...
[ikiwiki.git] / IkiWiki / Plugin / edittemplate.pm
index 742413c94583a761ec6c180735444882ae343e41..226f83bb4bdfc6dfb11dd326fd6db9d02aae8eae 100644 (file)
@@ -56,10 +56,15 @@ sub preprocess (@) {
        }
 
        my $link=linkpage($params{template});
+       add_depends($params{page}, $link, deptype("presence"));
        my $bestlink=bestlink($params{page}, $link);
+       if (! length $bestlink) {
+               add_depends($params{page}, "templates/$link", deptype("presence"));
+               $link="/templates/".$link;
+               $bestlink=bestlink($params{page}, $link);
+       }
        $pagestate{$params{page}}{edittemplate}{$params{match}}=$bestlink;
 
-       add_depends($params{page}, $link, deptype("presence"));
        return "" if ($params{silent} && IkiWiki::yesno($params{silent})) &&
                length $bestlink;
        return sprintf(gettext("edittemplate %s registered for %s"),