From dab53a697b8f58db9bef819dc9b6f5c3a592fe56 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 4 Jan 2016 18:17:51 -0800 Subject: [PATCH] collection: tiny optimization to #url_template --- lib/jekyll/collection.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index ea6a81b6..c7607171 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -186,9 +186,7 @@ module Jekyll # # Returns the URL template to render collection's documents at. def url_template - metadata.fetch('permalink') do - Utils.add_permalink_suffix("/:collection/:path", site.permalink_style) - end + metadata['permalink'] ||= Utils.add_permalink_suffix("/:collection/:path", site.permalink_style) end # Extract options for this collection from the site configuration.