]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* In img tag, allow link=no to disable link to full size image. Thanks,
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 15 Jul 2007 19:00:07 +0000 (19:00 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 15 Jul 2007 19:00:07 +0000 (19:00 +0000)
  Nis Martensen. Closes: #433188

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

index a453a49ba43321c1261ae12db846c1c3adb88c5e..c4e4a6f220beae57c19c239db73fa1ee624cd678 100644 (file)
@@ -96,12 +96,19 @@ sub preprocess (@) { #{{{
                return "[[img ".sprintf(gettext("failed to determine size of image %s"), $file)."]]";
        }
 
                return "[[img ".sprintf(gettext("failed to determine size of image %s"), $file)."]]";
        }
 
-       return '<a href="'.$fileurl.'"><img src="'.$imgurl.
+       my $imgtag='<img src="'.$imgurl.
                '" alt="'.$alt.'" width="'.$im->Get("width").
                '" height="'.$im->Get("height").'"'.
                (exists $params{class} ? ' class="'.$params{class}.'"' : '').
                (exists $params{id} ? ' id="'.$params{id}.'"' : '').
                '" alt="'.$alt.'" width="'.$im->Get("width").
                '" height="'.$im->Get("height").'"'.
                (exists $params{class} ? ' class="'.$params{class}.'"' : '').
                (exists $params{id} ? ' id="'.$params{id}.'"' : '').
-               ' /></a>';
+               ' />';
+
+       if (! defined $params{link} || lc($params{link}) eq 'yes') {
+               return  '<a href="'.$fileurl.'">'.$imgtag.'</a>';
+       }
+       else {
+               return $imgtag;
+       }
 } #}}}
 
 1
 } #}}}
 
 1
index 1bbd4149de9a41c0d70cb5882412c7de69b9e3c8..79d276d7c808fe64908c7b517759e85b7dad7488 100644 (file)
@@ -11,8 +11,10 @@ ikiwiki (2.4) UNRELEASED; urgency=low
   * Use type= not style= in html for alternate stylesheets, which is more
     correct (but in my testing both epiphany and iceweasel work ok with
     style=text/css).
   * Use type= not style= in html for alternate stylesheets, which is more
     correct (but in my testing both epiphany and iceweasel work ok with
     style=text/css).
+  * In img tag, allow link=no to disable link to full size image. Thanks,
+    Nis Martensen. Closes: #433188
 
 
- -- Joey Hess <joeyh@debian.org>  Fri, 13 Jul 2007 16:28:47 -0400
+ -- Joey Hess <joeyh@debian.org>  Sun, 15 Jul 2007 14:59:23 -0400
 
 ikiwiki (2.3) unstable; urgency=low
 
 
 ikiwiki (2.3) unstable; urgency=low
 
index 418ef6d46b9cf5aedd3ccd517e4c80fa40cd3a21..63006443a443b80490e096f6c983e818572c01cb 100644 (file)
@@ -26,6 +26,10 @@ making the image smaller than the specified size.
 You can also pass `alt`, `class` and `id` parameters. These are passed through
 unchanged to the html img tag.
 
 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
+to the full size version. By default it does; set "link=no" to disable
+this.
+
 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.