diff options
author | Amitai Schlair <schmonz-web-ikiwiki@schmonz.com> | 2013-02-18 18:01:13 -0500 |
---|---|---|
committer | Amitai Schlair <schmonz-web-ikiwiki@schmonz.com> | 2013-02-18 18:01:13 -0500 |
commit | ac8aa3a69a46716907f62404893ac99a3c52bce2 (patch) | |
tree | 04991fe45afc8c447a7c56824ec4bf7cbe863e9e /IkiWiki | |
parent | 00a63f1c5a97c5e7f3408966554f85d752e45a74 (diff) | |
download | ikiwiki-ac8aa3a69a46716907f62404893ac99a3c52bce2.tar ikiwiki-ac8aa3a69a46716907f62404893ac99a3c52bce2.tar.gz |
Make enclosure follow WikiLink LinkingRules.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 8 |
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}); } |