From 9a9e09390386bdbf4d4f6de5f7cc7ef2769def0d Mon Sep 17 00:00:00 2001 From: fauno <fauno@endefensadelsl.org> Date: Wed, 8 Apr 2020 16:19:44 -0300 Subject: [PATCH] prevent nil slugs --- lib/jekyll-pandoc-multiple-formats/pandoc_file.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb index bc1f8d2..4841177 100644 --- a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb +++ b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb @@ -36,11 +36,11 @@ module Jekyll @last_cat = nil @extra = extra - @single_post = not(posts.is_a? Array) + @single_post = !(posts.is_a? Array) if single_post? + @title = title || posts.data['title'] @posts = [posts] - @title = title or posts.data['title'] else @posts = posts @@ -76,7 +76,7 @@ module Jekyll # if permalink ends with trailing .html or trailing slash, path now ends with proper suffix # for other cases (permalink with no trailing extension or slash), append format # (ie /year/month/slug permalink --> /year/month/slug.pdf) - if not path.end_with? ".#{@format}" + unless path.end_with? ".#{@format}" path << '.' path << @format end -- GitLab