summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index e7b96bd..ebbf4d7 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -194,11 +194,12 @@ sub preprocess (@) {
elsif ($key eq 'script') {
my $defer=exists $params{defer} ? ' defer="defer"' : '';
my $async=exists $params{async} ? ' async="async"' : '';
+ my $srcurl=$value;
my $js=bestlink($page, $value.".js");
- if (! length $js) {
- error gettext("script not found");
+ if (length $js) {
+ $srcurl=urlto($js, $page);
}
- push @{$metaheaders{$page}}, scrub('<script src="'.urlto($js, $page).
+ push @{$metaheaders{$page}}, scrub('<script src="'. $srcurl .
'"' . $defer . $async . ' type="text/javascript"></script>',
$page, $destpage);
}