From dcfd914210f70323bdb8c8820cc2eed8f83f4f1f Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 8 Mar 2024 22:43:18 -0800 Subject: Write JSON output files in mksite --- NEWS | 1 + lib/MGA/Advisories.pm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 8a16eb6..74404ba 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ Version X - template: change default CVE year to 2024 - use https: links where possible - add 'showjson' command to output an advisory in OSV JSON format +- have 'mksite' write JSON output files as well Version 0.27 diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm index c8514fa..8ce3581 100644 --- a/lib/MGA/Advisories.pm +++ b/lib/MGA/Advisories.pm @@ -620,6 +620,7 @@ sub output_pages { ENCODING => 'utf8', INCLUDE_PATH => $config->{tmpl_dir}, OUTPUT_PATH => $config->{out_dir}, + EVAL_PERL => 1, ); foreach my $adv (keys %{$advdb->{advisories}}) { my $vars = { @@ -630,6 +631,7 @@ sub output_pages { tools => \%tools, }; process_template($template, 'advisory', $vars, $basename{ID}->($adv)); + process_template($template, 'advisory', $vars, $basename{ID}->($adv), 'json'); } foreach my $by (['rel', 'by_rel'], ['CVE', 'by_cve'], ['src', 'by_src']) { foreach my $r (keys %{$advdb->{$by->[1]}}) { -- cgit v1.2.1