aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2013-02-18 18:01:13 -0500
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2013-02-18 18:01:13 -0500
commitac8aa3a69a46716907f62404893ac99a3c52bce2 (patch)
tree04991fe45afc8c447a7c56824ec4bf7cbe863e9e /IkiWiki
parent00a63f1c5a97c5e7f3408966554f85d752e45a74 (diff)
downloadikiwiki-ac8aa3a69a46716907f62404893ac99a3c52bce2.tar
ikiwiki-ac8aa3a69a46716907f62404893ac99a3c52bce2.tar.gz
Make enclosure follow WikiLink LinkingRules.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index cb0768b91..c77837e3c 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -122,6 +122,13 @@ sub preprocess (@) {
return "";
}
elsif ($key eq 'enclosure') {
+ my $link=bestlink($page, $value);
+ if (! length $link) {
+ error gettext("enclosure not found")
+ }
+ add_depends($page, $link, deptype("presence"));
+
+ $value=urlto($link, $page);
$pagestate{$page}{meta}{enclosure}=$value;
}
elsif ($key eq 'author') {
@@ -322,7 +329,6 @@ sub pagetemplate (@) {
}
if (exists $pagestate{$page}{meta}{enclosure}) {
- # XXX what if the enclosure doesn't exist?
$template->param(enclosure => $pagestate{$page}{meta}{enclosure});
}