trvsdnn / frank

Static Site Non-Framework
http://github.com/blahed/frank
MIT License
415 stars 30 forks source link

exporting? etc from templates #60

Closed edrex closed 12 years ago

edrex commented 12 years ago

I need a hack like

- if Frank::Setting.exporting?
  %link{:charset => "utf-8", :href => "/css/cloudfeet.css", :rel => "stylesheet", :type => "text/css"}
- else
  %link{:charset => "utf-8", :href => "/less/cloudfeet.less", :rel => "stylesheet/less", :type => "text/css"}
  %script{:type => "text/javascript", :src => "/js/less.js"}

to work around the less gem segfaulting ( not frank's fault, obviously :).

But it seems I don't have access to Setting from templates:

The error, « uninitialized constant Frank::Setting »
occurred

It seems like it would be generally useful to be able to find out what mode we're in from the templates. What's the simplest way to do this?

Thanks :)

trvsdnn commented 12 years ago

Check this https://github.com/blahed/frank/issues/58 ;)

Hopefully that fixes it?