]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/img.pm
* img: Allow link=somepage to cause the image to link to a given page.
[ikiwiki.git] / IkiWiki / Plugin / img.pm
index c4e4a6f220beae57c19c239db73fa1ee624cd678..14a32f63542fb827e40ff926771982436e02f59a 100644 (file)
@@ -106,6 +106,10 @@ sub preprocess (@) { #{{{
        if (! defined $params{link} || lc($params{link}) eq 'yes') {
                return  '<a href="'.$fileurl.'">'.$imgtag.'</a>';
        }
+       elsif (length bestlink($params{page}, $params{link})) {
+               return htmllink($params{page}, $params{destpage},
+                       $params{link}, linktext => $imgtag);
+       }
        else {
                return $imgtag;
        }