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-19 20:22:46 -0500 |
commit | 0e278c4a848e0b3ddc0162db9dc135e791bd9477 (patch) | |
tree | 7b9357ce58e08163e411e76c2ebb634f37c4cdaf /IkiWiki | |
parent | 45d58983d2609b43cba8eb5d086812d6042d76a5 (diff) | |
download | ikiwiki-0e278c4a848e0b3ddc0162db9dc135e791bd9477.tar ikiwiki-0e278c4a848e0b3ddc0162db9dc135e791bd9477.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}); } |