diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-09-22 16:46:27 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-09-22 16:46:27 +0000 |
commit | 622b866f3ee3d3b5fe76f913559a0afae66af001 (patch) | |
tree | 8c50af3ae2b4daed7fe01d12fd771f4b873cccc2 /IkiWiki | |
parent | 7bde880fa8cf2e7d3413a7ede7ae5b604a97e85b (diff) | |
download | ikiwiki-622b866f3ee3d3b5fe76f913559a0afae66af001.tar ikiwiki-622b866f3ee3d3b5fe76f913559a0afae66af001.tar.gz |
* img: Allow link=somepage to cause the image to link to a given page.
Slight overriding of link, as link=no is still used to disable the linking
entirely. Unless you have a page named "no"..
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/img.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index c4e4a6f22..14a32f635 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -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; } |