Skip to content

Instantly share code, notes, and snippets.

@jagthedrummer
Created August 11, 2014 21:20
Show Gist options
  • Save jagthedrummer/6fa9e7339a4bd337c144 to your computer and use it in GitHub Desktop.
Save jagthedrummer/6fa9e7339a4bd337c144 to your computer and use it in GitHub Desktop.
Dorking with page titles in MiddleMan
helpers do
def default_title
title = current_page.data.title || @page_title
title
end
def page_title
title = default_title
if title.present?
title += " @ "
else
title = ""
end
title += "OctoLabs"
title
end
end
<title><%= page_title %></title>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment