Skip to content
Snippets Groups Projects
Unverified Commit 38d1c5d0 authored by fauno's avatar fauno
Browse files

Merge branch 'extless-permalinks' of...

Merge branch 'extless-permalinks' of git://github.com/pniedzielski/jekyll-pandoc-multiple-formats into pniedzielski-extless-permalinks
parents 8403a745 e31c69f2
No related branches found
No related tags found
No related merge requests found
......@@ -36,22 +36,20 @@ module Jekyll
@last_cat = nil
@extra = extra
if posts.is_a? Array
@single_post = false
@single_post = not(posts.is_a? Array)
if single_post?
@posts = [posts]
@title = title or posts.data['title']
else
@posts = posts
raise ArgumentError.new "'title' argument is required for multipost file" unless title
@title = title
@slug = Utils.slugify(@title)
else
@single_post = true
@posts = [posts]
@title = title || posts.data['title']
@slug = posts.data['slug']
end
self
@slug = Utils.slugify(@title)
end
def path
......@@ -75,6 +73,14 @@ module Jekyll
path << @format
end
# 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}"
path << '.'
path << @format
end
path
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment