From 84f67036ca7a3c4353f8ed1a9a033ba612957819 Mon Sep 17 00:00:00 2001 From: fauno Date: Wed, 28 Feb 2018 17:49:06 -0300 Subject: [PATCH] hooks need to run anyway --- lib/jekyll-pandoc-multiple-formats/generator.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/jekyll-pandoc-multiple-formats/generator.rb b/lib/jekyll-pandoc-multiple-formats/generator.rb index f8e948e..bf4a839 100644 --- a/lib/jekyll-pandoc-multiple-formats/generator.rb +++ b/lib/jekyll-pandoc-multiple-formats/generator.rb @@ -30,13 +30,10 @@ class PandocGenerator < Generator def generate_post_for_output(post, output) Jekyll.logger.debug 'Pandoc:', post.data['title'] - Jekyll::Hooks.trigger :posts, :pre_render, post, { format: output } pandoc_file = PandocFile.new(@site, output, post) return unless pandoc_file.write - Jekyll::Hooks.trigger :posts, :post_render, post, { format: output } - @site.keep_files << pandoc_file.relative_path @pandoc_files << pandoc_file end @@ -88,10 +85,10 @@ def generate(site) @config.outputs.each_pair do |output, _| Jekyll.logger.info 'Pandoc:', "Generating #{output}" - if @config.generate_posts? - @site.posts.docs.each do |post| - generate_post_for_output post, output - end + @site.posts.docs.each do |post| + Jekyll::Hooks.trigger :posts, :pre_render, post, { format: output } + generate_post_for_output(post, output) if @config.generate_posts? + Jekyll::Hooks.trigger :posts, :post_render, post, { format: output } end if @config.generate_categories?