From bb51e81762587364ae571b1f0a59955637e0e4a5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Apr 2008 12:58:36 -0400 Subject: [PATCH] img: Support a title attribute, will be passed through to html. Closes: #478718 --- IkiWiki/Plugin/img.pm | 3 +++ debian/changelog | 2 ++ doc/plugins/img.mdwn | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index b6e7c9e41..abc7e099a 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -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=''.$alt.''; diff --git a/debian/changelog b/debian/changelog index 1c22e9faa..b7daeec27 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sat, 26 Apr 2008 15:09:36 -0400 diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn index 06c8429c8..b5eef148f 100644 --- a/doc/plugins/img.mdwn +++ b/doc/plugins/img.mdwn @@ -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 -- 2.26.2