9

A friend of mine asked to create a static website and I found that making such site using Sinatra is a pure joy. I just wrote all my routes like this:

get '/index.html' do
  haml :index
end

get '/app.css' do
  sass :app
end
....

So I was able to use layouts, and haml and sass to put site together quickly.

To create the static site I used

wget -r -l2 http://localhost:4567

Which did work pretty well, but I imagine there is a better way to create a static site from a Sinatra code?

3
  • does this grab background images for you? or do you need to write routes for them too? wget is not 'getting' background img's referenced in my sass files. May 28, 2010 at 9:38
  • yes, in my case it did work for style bg images as well
    – dimus
    Jun 7, 2010 at 18:41
  • stasis.me seem to be another neat way for sinatra > static html conversion
    – dimus
    Feb 10, 2012 at 16:41

3 Answers 3

3

Try Httrack

2

Try sinatra-export, an extension made exactly for this purpose with Sinatra :

https://github.com/hooktstudios/sinatra-export

See also this project generator for dealing with assets too :

https://github.com/hooktstudios/sinatra-static-bp

0

Try StaticMatic.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.