Skip to content

Commit

Permalink
hooks need to run anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
fauno committed Feb 28, 2018
1 parent 441045e commit 84f6703
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/jekyll-pandoc-multiple-formats/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 84f6703

Please sign in to comment.