Skip to content

Commit

Permalink
Merge tag '0.2.7' into develop
Browse files Browse the repository at this point in the history
several fixes
  • Loading branch information
fauno committed Jan 10, 2017
2 parents 1aa1f83 + 82f4254 commit 1c67b0d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
7 changes: 7 additions & 0 deletions lib/jekyll-pandoc-multiple-formats/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def generate(site)
@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
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-pandoc-multiple-formats/imposition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def to_nup
# 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]
Expand Down
14 changes: 6 additions & 8 deletions lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def initialize(site, format, posts, title = nil)
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
Expand Down Expand Up @@ -185,13 +185,11 @@ def pdf_cover

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

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-pandoc-multiple-formats/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module JekyllPandocMultipleFormats
VERSION = '0.2.6'
VERSION = '0.2.7'
end

0 comments on commit 1c67b0d

Please sign in to comment.