Skip to content

Instantly share code, notes, and snippets.

@vertiginous
Created February 10, 2010 07:11
Show Gist options
  • Save vertiginous/300095 to your computer and use it in GitHub Desktop.
Save vertiginous/300095 to your computer and use it in GitHub Desktop.
# 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