Hopla is not distributed as a gem, and that's intentional: the idea is you'd start your project's
Rakefile by downloading it, and adding further tasks on top.
$ wget https://raw.github.com/juliocesar/hopla.io/master/Rakefile
$ rake hopla
What will likely happen is Hopla will tell you you need to install a few gems. Install them either by running the command as indicated in the output, or by adding the gems indicated to your
Gemfile and calling
Hopla will create the following directory structure:
$ rake hopla FORCE_INDEX=1
This will force the template in
be rendered at all times.
Template rendering is handled by Tilt. Which means as long as you have the necessary library installed for the template format you want (e.g.: the
haml gem for
.haml templates), it will Just Work™. So Jade,
Slim, etc, are all welcome.
If you create a template in
http://localhost:4567/foo will render it.
Try to avoid keeping static HTML files in here as Tilt won't know what to do with it. Keep them in the
public dir instead.
This just acts like a common public directory. I keep my images and fonts in here.
Important: if you have a static HTML file in a path that's equivalent to a template path (e.g.: templates/foo.haml exists and you also have public/foo.html), the static file will take priority and be served instead.
You don't want to depend on Hopla to serve the application you built with it. I
wrote a rake task that compiles what's required by the existing templates into the
public dir, so you can host it with a common webserver.
In the console, run:
$ rake hopla:compile
- compile all templates in
- parse each HTML file.
- compile all styles and scripts sourced in them.
Using Compass and other libraries
Compass is made available in the SASS path, but not automatically loaded. Which means in order to use it, you need to require it from your SASS files.
Any other libraries can be used by dropping them in the
assets/stylesheets folder and
@importing them in the same way.
Extras work like plugins. Hopla will load any Ruby file it finds in a
extras folder within the project directory. Check the extras folder on GitHub for examples.
Apps/sites built using it
It has none.