From 8c8e2db0e53e145a250824a39a6b5efd75b79a60 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 1 May 2018 05:30:11 +0530 Subject: [PATCH] Memoize computing excerpt's relative_path (#6951) Merge pull request 6951 --- lib/jekyll/excerpt.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index d270624c..18d456ea 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -48,7 +48,7 @@ module Jekyll # # Returns the relative_path for the doc this excerpt belongs to with #excerpt appended def relative_path - File.join(doc.relative_path, "#excerpt") + @relative_path ||= File.join(doc.relative_path, "#excerpt") end # Check if excerpt includes a string