* In img tag, allow link=no to disable link to full size image. Thanks,

Nis Martensen. Closes: #433188
master
joey 2007-07-15 19:00:07 +00:00
parent f194e477c4
commit 3bd439fa03
3 changed files with 16 additions and 3 deletions

View File

@ -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

4
debian/changelog vendored
View 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).
* 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

View 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.
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.