From 21de43090a0b120bc18d39841d949f8868758001 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Mon, 22 Jul 2013 16:23:40 +0200 Subject: [PATCH] Posts: move slug to title in a separate method --- lib/jekyll/post.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 411f54de..5d08807f 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -113,7 +113,12 @@ module Jekyll # # Returns the post 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 # Public: the path to the post relative to the site source,