]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/edittemplate.pm
document external links
[git.ikiwiki.info.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"),