Created
February 10, 2010 07:11
-
-
Save vertiginous/300095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mkdir lib | |
# touch lib/toto_ext.rb | |
# require 'lib/toto_ext' in config.ru | |
# use <%= blog_title %> in layout.rhtml | |
module Toto | |
class Site | |
class Context | |
def blog_title | |
if @path == 'index' | |
title | |
elsif @path.scan(/\//).size > 2 | |
"#{@config[:title]} - #{title}" | |
else | |
"#{title} - #{@path}" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment