Remove extra OR condition since a missing hash key will return a nil anyway. Added a test to catch this nil condition since it was missing to begin with. Reduced line length in test_page.rb

This commit is contained in:
Zshawn Syed
2016-01-21 23:44:30 -06:00
parent b3ddd985a4
commit 4ecdf6ce10
2 changed files with 9 additions and 3 deletions

View File

@@ -63,8 +63,7 @@ module Jekyll
#
# Returns the String permalink or nil if none has been set.
def permalink
return nil if data.nil? || data['permalink'].nil?
data['permalink']
data.nil? ? nil : data['permalink']
end
# The template of the permalink.