gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 121 forks source link

Configure how Tilt renders pages #146

Closed gma closed 8 months ago

gma commented 10 years ago

At the moment the Markdown, Textile and Haml pages are rendered by Tilt, with the default options for each renderer. If you want to configure the renderer you need to pass it a hash of options, so we'd need a way to configure it on a per-site basis.

If we define a method that can be overriden in app.rb, that would cover it. This is untested, but it's what I've got in mind…

def convert_to_html(format, scope, text)
  text = add_p_tags_to_haml(text) if @format == :haml
  template = Tilt[format].new(renderer_config(@format)) { text }
  template.render(scope)
end

def renderer_config(format)
  {}
end
gma commented 10 years ago

I've started working on this, as I need it for configuring RedCarpet.

komidore64 commented 9 years ago

:+1: