Skip to content

Commit

Permalink
Memoize the return value of Document#url
Browse files Browse the repository at this point in the history
Running 'bundle exec rake site:generate' locally, this brings generation time from 16 seconds down to 8 seconds.
  • Loading branch information
parkr committed Aug 4, 2017
1 parent 73419cb commit e0a74a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/_docs/history.md
Expand Up @@ -27,7 +27,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- add plugins for multiple page pagination ([#6055]({{ site.repository }}/issues/6055))
- Update minimum Ruby version in installation.md ([#6164]({{ site.repository }}/issues/6164))
- [docs] Add information about finding a collection in `site.collections` ([#6165]({{ site.repository }}/issues/6165))
- Add {%raw%} to Liquid example on site ([#6179]({{ site.repository }}/issues/6179))
- Add {% raw %}`{% raw %}`{% endraw %} to Liquid example on site ([#6179]({{ site.repository }}/issues/6179))
- Added improved Pug plugin - removed 404 Jade plugin ([#6174]({{ site.repository }}/issues/6174))
- Linking the link ([#6210]({{ site.repository }}/issues/6210))
- Small correction in documentation for includes ([#6193]({{ site.repository }}/issues/6193))
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/document.rb
Expand Up @@ -204,7 +204,7 @@ def permalink
#
# Returns the computed URL for the document.
def url
@url = URL.new({
@url ||= URL.new({
:template => url_template,
:placeholders => url_placeholders,
:permalink => permalink,
Expand Down

0 comments on commit e0a74a0

Please sign in to comment.