Convertible: consolidate empty check into Convertible#read

This commit is contained in:
Parker Moore 2016-01-15 15:51:32 -08:00
parent 156e093b5c
commit 948dcf2714
1 changed files with 2 additions and 11 deletions

View File

@ -61,8 +61,8 @@ module Jekyll
Jekyll.logger.abort_with "Fatal:", "Invalid YAML front matter in #{File.join(base, name)}" Jekyll.logger.abort_with "Fatal:", "Invalid YAML front matter in #{File.join(base, name)}"
end end
if self.data['permalink'] && empty_permalink?(self.data['permalink']) if self.data['permalink'] && self.data['permalink'].size == 0
Jekyll.logger.error "Error:", "Invalid permalink in #{File.join(base, name)}" Jekyll.logger.abort_with "Fatal:", "Invalid permalink in #{File.join(base, name)}"
end end
self.data self.data
@ -270,15 +270,6 @@ module Jekyll
Jekyll::Hooks.trigger hook_owner, :post_render, self Jekyll::Hooks.trigger hook_owner, :post_render, self
end end
# Check data permalink
#
# permalink - the data permalink
#
# Returns true if the permalink is valid, false if otherwise
def empty_permalink?(permalink)
permalink.length == 0
end
# Write the generated page file to the destination directory. # Write the generated page file to the destination directory.
# #
# dest - The String path to the destination dir. # dest - The String path to the destination dir.