Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamincharity/1640777 to your computer and use it in GitHub Desktop.
Save benjamincharity/1640777 to your computer and use it in GitHub Desktop.
Add this inside config.rb
def page_classes
path = request.path_info.dup
path << settings.index_file if path.match(%r{/$})
path = path.gsub(%r{^/}, '')
classes = []
parts = path.split('.')[0].split('/')
parts.join(' ')
end
%section{class: "#{page_classes}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment