diff --git a/lib/jekyll-pandoc-multiple-formats/generator.rb b/lib/jekyll-pandoc-multiple-formats/generator.rb index 5a57b2c91fe4a1ee5211a5932fb97c357b310362..a8174ea7ebd284893b12ca4b1b2792c85ead9940 100644 --- a/lib/jekyll-pandoc-multiple-formats/generator.rb +++ b/lib/jekyll-pandoc-multiple-formats/generator.rb @@ -50,6 +50,13 @@ class PandocGenerator < Generator @site.post_attr_hash('categories').each_pair do |title, posts| posts.sort! pandoc_file = PandocFile.new(@site, output, posts, title) + + if @site.keep_files.include? pandoc_file.relative_path + puts "#{pandoc_file.relative_path} is a category file AND a post file" + puts 'change the category name to fix this' + next + end + next unless pandoc_file.write @site.keep_files << pandoc_file.relative_path diff --git a/lib/jekyll-pandoc-multiple-formats/imposition.rb b/lib/jekyll-pandoc-multiple-formats/imposition.rb index 7326aaadc3e0c9db0e724d1108c322cb64cd0943..4289420418d1a1b7dcfc4b9f17c3e61eedf6dbdd 100644 --- a/lib/jekyll-pandoc-multiple-formats/imposition.rb +++ b/lib/jekyll-pandoc-multiple-formats/imposition.rb @@ -68,7 +68,7 @@ module JekyllPandocMultipleFormats # Split in halves # [ [ 1, 2, 3, 4, 5, 6, 7, 8 ], # [ 9, 10, 11, 12, 13, 14, '{}', '{}' ] ] - halved = fold.each_slice(@signature / 2).to_a + halved = fold.each_slice(fold.size / 2).to_a # Add a nil as last page. When we reverse it and intercalate by # two pages, we'll have [nil, last_page] instead of # [last_page,second_to_last_page] diff --git a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb index aa8b881d52d4605c84e6948e12b876003f1147fa..14b698f1ef53849a8d9522eae169eeca77f69538 100644 --- a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb +++ b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb @@ -41,12 +41,12 @@ module Jekyll raise ArgumentError.new "'title' argument is required for multipost file" unless title @title = title - @slug = Utils.slugify(title) else @posts = [posts] - @slug = posts.data['slug'] @title = posts.data['title'] unless title end + + @slug = Utils.slugify(title) end def path @@ -185,13 +185,11 @@ module Jekyll def pdf_cover! if has_cover? && !File.exists?(pdf_cover) - Dir::chdir(@site.config['source']) do - Open3::popen3("convert \"#{cover}\" \"#{pdf_cover}\"") do |stdin, stdout, stderr, thread| - STDERR.print stderr.read + Open3::popen3("convert \"#{cover}\" \"#{pdf_cover}\"") do |stdin, stdout, stderr, thread| + STDERR.print stderr.read - # Wait for the process to finish - thread.value - end + # Wait for the process to finish + thread.value end end diff --git a/lib/jekyll-pandoc-multiple-formats/version.rb b/lib/jekyll-pandoc-multiple-formats/version.rb index f06162dead1d74a753522add3d2800bb3cc7574e..a49a69c4aae289d421f7c54e79fc03ce32d5c2fc 100644 --- a/lib/jekyll-pandoc-multiple-formats/version.rb +++ b/lib/jekyll-pandoc-multiple-formats/version.rb @@ -1,3 +1,3 @@ module JekyllPandocMultipleFormats - VERSION = '0.2.6' + VERSION = '0.2.7' end