From 7e7dea078bce3437b9a14d96079ddd68a5f0aab9 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 25 Jan 2011 10:28:52 +0100 Subject: meta plugin: script support (cherry picked from commit 44c5b27f88fdbfb4fdd061f600039e490eaeff92) --- IkiWiki/Plugin/meta.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 1a9f94a12..eebe3460f 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -179,6 +179,17 @@ sub preprocess (@) { '" title="'.encode_entities($title). "\" type=\"text/css\" />", $page, $destpage); } + elsif ($key eq 'script') { + my $defer=exists $params{defer} ? ' defer="defer"' : ''; + my $async=exists $params{async} ? ' async="async"' : ''; + my $js=bestlink($page, $value.".js"); + if (! length $js) { + error gettext("script not found"); + } + push @{$metaheaders{$page}}, scrub('