summaryrefslogtreecommitdiffstats
path: root/.ikiwiki/IkiWiki/Plugin/pandoc.pm
diff options
context:
space:
mode:
Diffstat (limited to '.ikiwiki/IkiWiki/Plugin/pandoc.pm')
-rwxr-xr-x.ikiwiki/IkiWiki/Plugin/pandoc.pm22
1 files changed, 16 insertions, 6 deletions
diff --git a/.ikiwiki/IkiWiki/Plugin/pandoc.pm b/.ikiwiki/IkiWiki/Plugin/pandoc.pm
index a8b1649..b208b9a 100755
--- a/.ikiwiki/IkiWiki/Plugin/pandoc.pm
+++ b/.ikiwiki/IkiWiki/Plugin/pandoc.pm
@@ -608,6 +608,10 @@ sub htmlize ($@) {
$pagestate{$page}{meta}{pandoc_primary_author} = $scalar_meta{primary_author}
}
+ # DEBUG
+ $pagestate{$page}{meta}{fripost_debug_label_1} = 'fripost debug value';
+ # END
+
# The bibliography may be set in a Meta block in the page or in the .setup file.
# If both are present, the Meta block has precedence.
for my $bibl ($scalar_meta{bibliography}, $config{pandoc_bibliography}) {
@@ -710,7 +714,7 @@ sub htmlize ($@) {
# DEBUG Print pagestate again
$fnm = sprintf "%s.%.1d.%s", $fnm_pfx, $m++, "return-pagestate";
open($fh, '>>', $fnm);
- my %pagestate_dumper = (
+ %pagestate_dumper = (
$page => $pagestate{$page},
);
print $fh Data::Dumper->Dump([\%pagestate_dumper], [qw("pagestate")]), "\n";
@@ -736,23 +740,29 @@ sub pagetemplate (@) {
my %params = @_;
my $page = $params{page};
+ my $template = $params{template};
+
# DEBUG
- print "D: Run pagetemplate for $page\n";
+ my $filename = $template->{'options'}{'filename'};
+ $filename =~ /^.*\/([a-z]*).tmpl$/;
+ my $filenamebase = $1;
+ print "D: Run pagetemplate for $page and $filenamebase \n";
# END
- my $template = $params{template};
foreach my $k (keys %{$pagestate{$page}{meta}}) {
- next unless $k =~ /^pandoc_/;
+ next unless $k =~ /^(pandoc_|fripost_)/;
$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);
my $m = 0;
- my $fnm = sprintf "%s.%.1d.%s", $fnm_pfx, $m++, "data";
+ my $fnm = sprintf "%s.%s.%.1d.%s", $fnm_pfx, $filenamebase, $m++, "data";
open($fh, '>', $fnm) or die "Could not";
- print $fh Data::Dumper->Dump([%params], [qw(params)]), "\n";
+ my @keys = keys $template->%*;
print $fh Data::Dumper->Dump([$template], [qw(teplate)]), "\n";
+ # print $fh Data::Dumper->Dump([%params], [qw(params)]), "\n";
close $fh;
# END