img: Support a title attribute, will be passed through to html. Closes: #478718

master
Joey Hess 2008-04-30 12:58:36 -04:00
parent 112737535c
commit bb51e81762
3 changed files with 7 additions and 2 deletions

View File

@ -22,11 +22,13 @@ sub preprocess (@) { #{{{
}
my $size = $params{size} || $imgdefaults{$params{page}}->{size} || 'full';
my $alt = $params{alt} || $imgdefaults{$params{page}}->{alt} || '';
my $title = $params{title} || $imgdefaults{$params{page}}->{title} || '';
if ($image eq 'defaults') {
$imgdefaults{$params{page}} = {
size => $size,
alt => $alt,
title => $title,
};
return '';
}
@ -104,6 +106,7 @@ sub preprocess (@) { #{{{
my $imgtag='<img src="'.$imgurl.
'" alt="'.$alt.'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
(defined $title ? ' title="'.$title.'"' : '').
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';

2
debian/changelog vendored
View File

@ -6,6 +6,8 @@ ikiwiki (2.45) UNRELEASED; urgency=low
* Add PREFIX/bin to the hardcoded PATH within ikiwiki.
* Deal with different paths to perl when removing -T flag.
* Add missing de.po. Closes: #471540
* img: Support a title attribute, will be passed through to html.
Closes: #478718
-- Joey Hess <joeyh@debian.org> Sat, 26 Apr 2008 15:09:36 -0400

View File

@ -23,8 +23,8 @@ The `size` parameter is optional, defaulting to full size. Note that the
original image's aspect ratio is always preserved, even if this means
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`, `title`, `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=somepage" to link