diff options
author | Joey Hess <joey@kitenet.net> | 2007-12-28 16:14:43 -0500 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2007-12-28 16:14:43 -0500 |
commit | c2afda7f90c595d3256625c81aabc90252b7b07f (patch) | |
tree | 1e86e4983e7af8e0e8bb7068f745485962f75c3b | |
parent | 633f8d4dd3f21e5793f4aa8f5b9ca91156a64034 (diff) | |
download | ikiwiki-c2afda7f90c595d3256625c81aabc90252b7b07f.tar ikiwiki-c2afda7f90c595d3256625c81aabc90252b7b07f.tar.gz |
* img: Allow the link parameter to point to an exterior url.
-rw-r--r-- | IkiWiki/Plugin/img.pm | 4 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/plugins/img.mdwn | 3 | ||||
-rw-r--r-- | po/ikiwiki.pot | 8 |
4 files changed, 11 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 9385f6417..88a3d7b4d 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -106,7 +106,11 @@ sub preprocess (@) { #{{{ if (! defined $params{link} || lc($params{link}) eq 'yes') { return '<a href="'.$fileurl.'">'.$imgtag.'</a>'; } + elsif ($params{link} =~ /^\w+:\/\//) { + return '<a href="'.$params{link}.'">'.$imgtag.'</a>'; + } elsif (length bestlink($params{page}, $params{link})) { + add_depends($params{page}, $params{link}); return htmllink($params{page}, $params{destpage}, $params{link}, linktext => $imgtag, noimageinline => 1); diff --git a/debian/changelog b/debian/changelog index 81f31353b..aca79c6d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ ikiwiki (2.17) UNRELEASED; urgency=low * Improved parentlinks special case for index pages. * redir: Support for specifying anchors. * img: Avoid nesting images when linking to another image. Closes: #457780 + * img: Allow the link parameter to point to an exterior url. -- Joey Hess <joeyh@debian.org> Wed, 19 Dec 2007 16:39:07 -0500 diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn index 7858fd513..06c8429c8 100644 --- a/doc/plugins/img.mdwn +++ b/doc/plugins/img.mdwn @@ -28,7 +28,8 @@ 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 -to another page instead, or "link=no" to disable the link. +to another page instead, or "link=no" to disable the link, or +"link=http://url" to link to a given url. 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. diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 7745cce44..a9102965f 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-12-18 16:38-0500\n" +"POT-Creation-Date: 2007-12-27 19:28-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -239,15 +239,15 @@ msgstr "" msgid "stylesheet not found" msgstr "" -#: ../IkiWiki/Plugin/meta.pm:114 +#: ../IkiWiki/Plugin/meta.pm:116 msgid "redir page not found" msgstr "" -#: ../IkiWiki/Plugin/meta.pm:126 +#: ../IkiWiki/Plugin/meta.pm:129 msgid "redir cycle is not allowed" msgstr "" -#: ../IkiWiki/Plugin/meta.pm:143 +#: ../IkiWiki/Plugin/meta.pm:146 msgid "link is no longer supported" msgstr "" |