trvsdnn / frank

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

frankout throws exception on partials #6

Closed marcoy closed 14 years ago

marcoy commented 14 years ago

Frank-0.3.0 When I tried to use frankout to compile the project, it failed with an error. /Library/Ruby/Gems/1.8/gems/frank-0.3.0/lib/frank/base.rb:106:in `render': Template not found /Users/marcoy/tmp/Test/dynamic/_testpartial.html (Frank::TemplateError).

I looked into the code a bit and realized the method to_file_path() is not called if it is not running with Rack. The reason it failed is because, in the view the partials don't include file extensions, and render() normalizes the path by adding ".html" extensions to the partials; at the same time, to_file_path() is not called to try to find the corresponding templates in dynamic/

A quick hack I did was to change line 97 of base.rb to the following: path = to_file_path(path) if defined? @request or path.end_with?('.html')

Marco

trvsdnn commented 14 years ago

I'll write a test and get a patch version ready. Thanks