From: Amitai Schlair Date: Thu, 27 Jun 2013 04:21:20 +0000 (-0400) Subject: Instead of hacking back to $link, just provide it. X-Git-Tag: 3.20130904~88^2~4 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/b25f7700bde4981d1fb69d89c1451abc0c7bb87a?hp=e0ff81b48db087cc36e07a97db33e6af9411f64e Instead of hacking back to $link, just provide it. --- diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index e313eb775..455ac3ad5 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -672,11 +672,7 @@ sub genfeed ($$$$$@) { if (exists $pagestate{$p}{meta}{enclosure}) { my $absurl = $pagestate{$p}{meta}{enclosure}; - - # XXX better way to compute relative to srcdir? - my $file = $absurl; - $file =~ s|^$config{url}/||; - + my $file = $pagestate{$p}{meta}{enclosurefile}; genenclosure($itemtemplate, $absurl, $file); $fancy_enclosure_seen = 1; } diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 794f6d861..e7b96bdf1 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -130,6 +130,7 @@ sub preprocess (@) { $value=urlto($link, $page, 1); $pagestate{$page}{meta}{enclosure}=$value; + $pagestate{$page}{meta}{enclosurefile}=$link; # fallthrough } elsif ($key eq 'author') {