From b25f7700bde4981d1fb69d89c1451abc0c7bb87a Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Thu, 27 Jun 2013 00:21:20 -0400 Subject: [PATCH] Instead of hacking back to $link, just provide it. --- IkiWiki/Plugin/inline.pm | 6 +----- IkiWiki/Plugin/meta.pm | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) 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') { -- 2.39.5