From 0b21ceca95fa1f068229b55034a5c1774aff0808 Mon Sep 17 00:00:00 2001
From: fauno <fauno@endefensadelsl.org>
Date: Mon, 12 Jun 2017 14:13:55 -0300
Subject: [PATCH] use the slug of singular post

if we generate from title but the filename or frontmatter has another
slug, the file will be named inconsistently
---
 lib/jekyll-pandoc-multiple-formats/pandoc_file.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
index f60ca1a..4e2c8cc 100644
--- a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
+++ b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
@@ -41,12 +41,14 @@ module Jekyll
         raise ArgumentError.new "'title' argument is required for multipost file" unless title
 
         @title = title
+        @slug = Utils.slugify(@title)
       else
         @posts = [posts]
         @title = posts.data['title'] unless title
+        @slug  = posts.data['slug']
       end
 
-      @slug = Utils.slugify(@title)
+      self
     end
 
     def path
-- 
GitLab