gma / nesta

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

Add ability to specifiy a layout-wide template default #40

Closed zazena closed 12 years ago

zazena commented 13 years ago

Pseudo example for a layout:

Template: some_template_name
!!!
%html
  %head
    ...
  %body
    ...

Then in the page itself you specify the layout and have the default layout template applied. Of course the Template metadata tag could would still be useable in the page itself.

gma commented 13 years ago

Hi. Thanks for the suggestion. I like the idea of being able to specify a default template for a layout (or possibly a default layout for a template – is one significantly better for you than the other?).

I'll give it some thought. I'm not sure that metadata in the views/ folder is the way forward, as Sinatra is currently dealing with rendering the content of views and I'd like to avoid getting in its way. Perhaps a hash in app.rb that defined defaults would be a better approach.

zazena commented 13 years ago

Good question ... I guess there are arguments for layout-wide template or template-wide layout. Both possible? :)

A hash in app.rb or a specific section in config.yml would work I think.

gma commented 13 years ago

I'm thinking app.rb; it could get bundled with a theme then. I'll muse on it for a bit and see what comes up.

zazena commented 13 years ago

That makes perfect sense. Thx :)

gma commented 12 years ago

I haven't come up with an API for this that I don't feel adds complexity, rather than reducing it. I'm going to close it (at least for the moment) so I can focus on stuff in the tracker that I want to get done first.