summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-07-15 19:00:07 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-07-15 19:00:07 +0000
commit3bd439fa03c13f19e7305b82fff23779e303154d (patch)
treea74585f88ceec529d62fef3f4c53169ae13515b8
parentf194e477c4a3fe43cdf28e43476fce34b0ae1ccf (diff)
* In img tag, allow link=no to disable link to full size image. Thanks,
Nis Martensen. Closes: #433188
-rw-r--r--IkiWiki/Plugin/img.pm11
-rw-r--r--debian/changelog4
-rw-r--r--doc/plugins/img.mdwn4
3 files changed, 16 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index a453a49ba..c4e4a6f22 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -96,12 +96,19 @@ sub preprocess (@) { #{{{
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}.'"' : '').
- ' /></a>';
+ ' />';
+
+ if (! defined $params{link} || lc($params{link}) eq 'yes') {
+ return '<a href="'.$fileurl.'">'.$imgtag.'</a>';
+ }
+ else {
+ return $imgtag;
+ }
} #}}}
1
diff --git a/debian/changelog b/debian/changelog
index 1bbd4149d..79d276d7c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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).
+ * 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
diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn
index 418ef6d46..63006443a 100644
--- a/doc/plugins/img.mdwn
+++ b/doc/plugins/img.mdwn
@@ -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.
+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.