memoize name

This commit is contained in:
Ben Balter 2017-04-11 14:58:10 -05:00
parent 993eafce00
commit ee1b03cd0a
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
1 changed files with 10 additions and 10 deletions

View File

@ -49,16 +49,16 @@ module Jekyll
end
def name
@name ||= begin
return seo_name if seo_name
return unless homepage_or_about?
if site["social"] && site["social"]["name"]
format_string site["social"]["name"]
elsif site_title
format_string site_title
end
end
return @name if defined?(@name)
@name = if seo_name
seo_name
elsif !homepage_or_about?
nil
elsif site["social"] && site["social"]["name"]
format_string site["social"]["name"]
elsif site_title
format_string site_title
end
end
def description