Closed trisulnsm closed 13 years ago
Hello. I am having trouble reproducing this issue. In your example above, I do not see a layout file. Could you post your complete controller.rb
file? Also please tell me your Ruby version.
Thanks for looking into this.
Git issues doesnt seem to allow me to attach my sample project, so I created a gist with the 5 files.
https://gist.github.com/1274736
The files are
/controller.rb /layouts/layout.html.haml /releases/index.html.haml /releases/body.textile /releases/controller.rb
Unfortunately GIST doesnt allow subdirectories, so I used an underscore to name the files.
Basically I want to ignore the body.textile file because it is intended to be assembled by the haml files. Running stasis without the fix causes public/releases/index.html
to render without the layout. WIth the fix it renders correctly.
Thanks,
I downloaded your example and renamed to the directories you outlined. The layout was present in the index.html file that was generated.
What version of Ruby are you running?
Sorry , I didnt notice you asked this earlier -
The ruby version is
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
It is weird because it works fine when run under rdebug !!
Vivek, so sorry to have taken so long on this. Hopefully I haven't lost you :)
I believe I have fixed this in the latest release (1.1.14). Thanks for your patience.
Winton,
Havent lost me at all. Stasis is fantastic, I used it in conjunction with Twitter bootstrap to build this site (trisul.org) I am going to write up a detailed blog on how other folks can use this powerful combination.
As far as the problem, I worked around it by specifying layout for each file.
So instead of
layout /textile/ => '/layouts/docsection.html.haml'
I did
before /textile/ do layout '/layouts/docsection.html.haml' end
I will give the new build a spin and report back.
I ran into something that might be a bug or maybe I am using it wrong. Please take a look at this.
The problem happens when you render an 'ignored' document from one that is not ignored. If this happens, the doc that is not ignored is rendered without a layout.
Lets say you have this setup
Directory
Contents of file
index.html.haml
features.textile
controller.rb
Running stasis on this causes the index.html.haml to be rendered without a layout. Removing the ignore /textile/ code causes it to render correctly.
I dug down into the code found this
Changing the
@stasis.action._layout = nil
statement to@stasis.action._layout ||= nil
seems to solve the problem.This works for me but I would like to hear from you if this looks like a good enough fix.
Regards,
Vivek - thankful user of stasis