Posts: move slug to title in a separate method

This commit is contained in:
maul.esel 2013-07-22 16:23:40 +02:00
parent 5efadd6674
commit 21de43090a
1 changed files with 6 additions and 1 deletions

View File

@ -113,7 +113,12 @@ module Jekyll
# #
# Returns the post title # Returns the post title
def title def title
self.data.fetch("title", self.slug.split('-').select {|w| w.capitalize! || w }.join(' ')) self.data.fetch("title", self.titleize_slug)
end
# Turns the post slug into a suitable title
def titleize_slug
self.slug.split('-').select {|w| w.capitalize! || w }.join(' ')
end end
# Public: the path to the post relative to the site source, # Public: the path to the post relative to the site source,