From: Gustav Eek Date: Mon, 20 Jan 2020 17:36:08 +0000 (+0100) Subject: Feature. Push listed meta variables to template. X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=fd0d3342ea90328ff5b6b24b0b328a699683bedc;p=ikiwiki-pandoc.git Feature. Push listed meta variables to template. In function *pagetemplate*, template variables are added as pandas_* variables. This fix provides also those listed as scalar and list meta keys without the Pandoc prefix. --- diff --git a/pandoc.pm b/pandoc.pm index be44a06..9f945bf 100755 --- a/pandoc.pm +++ b/pandoc.pm @@ -611,7 +611,9 @@ sub pagetemplate (@) { my $page = $params{page}; my $template = $params{template}; foreach my $k (keys %{$pagestate{$page}{meta}}) { - next unless $k =~ /^pandoc_/; + next unless + (grep {/^$k$/} (@scalar_meta_keys, @list_meta_keys)) || + ($k =~ /^(pandoc_)/); $template->param($k => $pagestate{$page}{meta}{$k}); } return $template;