]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* img: Allow link=somepage to cause the image to link to a given page.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 22 Sep 2007 16:46:27 +0000 (16:46 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 22 Sep 2007 16:46:27 +0000 (16:46 +0000)
  Slight overriding of link, as link=no is still used to disable the linking
  entirely. Unless you have a page named "no"..

IkiWiki/Plugin/img.pm
debian/changelog
doc/plugins/img.mdwn
doc/plugins/img/discussion.mdwn

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>';
        }
        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;
        }
        else {
                return $imgtag;
        }
index 377bb41b8a51f2bcdd743c8387b4407cf3990bff..6935ccced19c6fc8d83fc6ff82988a104d7cb587 100644 (file)
@@ -9,8 +9,11 @@ ikiwiki (2.9) UNRELEASED; urgency=low
     are not included in the map. Include special styling for such pages.
   * map: Remove common prefixes and don't over-indent.
   * Add class option to htmllink().
     are not included in the map. Include special styling for such pages.
   * map: Remove common prefixes and don't over-indent.
   * Add class option to htmllink().
+  * 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"..
 
 
- -- Joey Hess <joeyh@debian.org>  Sat, 22 Sep 2007 12:31:22 -0400
+ -- Joey Hess <joeyh@debian.org>  Sat, 22 Sep 2007 12:36:37 -0400
 
 ikiwiki (2.8) unstable; urgency=low
 
 
 ikiwiki (2.8) unstable; urgency=low
 
index 63006443a443b80490e096f6c983e818572c01cb..5d93e90c50a011180cebde20d4abbe6e099aab6e 100644 (file)
@@ -27,8 +27,8 @@ You can also pass `alt`, `class` and `id` parameters. These are passed through
 unchanged to the html img tag.
 
 The `link` parameter is used to control whether the scaled down image links
 unchanged to the html img tag.
 
 The `link` parameter is used to control whether the scaled down image links
-to the full size version. By default it does; set "link=no" to disable
-this.
+to the full size version. By default it does; set "link=somepage" to link
+to another page instead, or "link=no" to disable the link.
 
 You can also set default values that will be applied to all later images on
 the page, unless overridden. Useful when including many images on a page.
 
 You can also set default values that will be applied to all later images on
 the page, unless overridden. Useful when including many images on a page.
index c6e6d33366c48448c46ed619a36208ef0b2283c2..c8a53632750c2924397d3c6e3dc32e5156246c88 100644 (file)
@@ -4,3 +4,4 @@ on <http://www.bddebian.com/~wiki/sidebar/> I'd like to have the
 logo link to \[[hurd/logo]] / <http://www.bddebian.com/~wiki/hurd/logo/>
 instead of linking to the PNG image file.  --[[tschwinge]]
 
 logo link to \[[hurd/logo]] / <http://www.bddebian.com/~wiki/hurd/logo/>
 instead of linking to the PNG image file.  --[[tschwinge]]
 
+> Done, use link=somepage --[[Joey]]