From 5dcfb79dd6b229411d4ef35ff88cb898bf412c3f Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Sat, 14 Dec 2019 16:13:55 +0100 Subject: Feature. Plugin. 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. --- .ikiwiki/IkiWiki/Plugin/pandoc.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.ikiwiki/IkiWiki') diff --git a/.ikiwiki/IkiWiki/Plugin/pandoc.pm b/.ikiwiki/IkiWiki/Plugin/pandoc.pm index 005f9f8..7551215 100755 --- a/.ikiwiki/IkiWiki/Plugin/pandoc.pm +++ b/.ikiwiki/IkiWiki/Plugin/pandoc.pm @@ -751,10 +751,11 @@ sub pagetemplate (@) { # END foreach my $k (keys %{$pagestate{$page}{meta}}) { - next unless $k =~ /^(pandoc_|fripost_)/; + next unless + (grep {/^$k$/} (@scalar_meta_keys, @list_meta_keys)) || + ($k =~ /^(pandoc_)/); $template->param($k => $pagestate{$page}{meta}{$k}); } - $template->param('date' => $pagestate{$page}{meta}{date}); # DEBUG Print pagetemplate data my $fnm_pfx = debug_get_filename_prefix ("pagetemplate", $page); -- cgit v1.2.3