Skip to content

Skeleton app for Sinatra project based on mobile-html5-boilerplate, Erb or Haml templating, Compass for styles and Coffeescript

Notifications You must be signed in to change notification settings

zonpantli/Sinatra-mobile-html5-boilerplate-Compass-Coffeescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sinatra-mobile-html5-boilerplate-Compass-Coffeescript is an empty Sinatra app configured to use Mobile Boilerplate, Compass for CSS handling and Coffeescript for Javascript.

Default templating with Erb, but haml is also supported by uncommenting couple of lines in sinatra_app.rb.

By default it uses ERB for templates. You can change that, however make sure to have the boilerplate in the format you like (someone said HAML?). Here are some links taken from the official Sinatra documentation that will help you out in making all of these changes.

public directory is directly from MBP (v1.1 as of writing), with following changes

  • index.html is removed, instead Sinatra uses template.erb with <%= yield %> added for content

  • This is not (yet) designed to co-operate with MBP's build script, so <script src="js/script.js"></script> is added. script.js is generated from script.coffee automatically.

  • demos, build etc. has been removed

  • config.rb is Compass config file, which reads custom styles from views/scss and generates corresponding css files under public/css

GETTING STARTED

In the fresh project directory, run

$ bundle install

Then in one terminal:

$ cd public
$ compass watch  #you need to have compass (`gem install compass`)

In another terminal

$ bundle install
$ rackup

Then visit http://localhost:9292 You can also use Shotgun to ease development instead of rackup.

COFFEESCRIPT SUPPORT

I'd advise you to install Coffee as a NPM module, as it gives you a bit more flexibility. Here are the instructions to do that.

DEPLOY

As a default, the Gemfile contains a group that you should uncomment if you want to deploy on Heroku. Deployment is standard, here's the guide to do that. You should be able to avoid configuration and just need to push the repo.

Since this is a skeleton project, Gemfile.lock is put to .gitignore. Remove it from your project's .gitignore if using Bundler

THANKS AND LINKS

This is essentially a hybrid of two similar projects, cloud8421's Sinatra-HTML5-boilerplate-with-ERB--Sass-and-CoffeeScript and jondot's sinatra-html5boilerplate-erb-compass. I don't claim any credit. Just customized those a bit to my taste.

About

Skeleton app for Sinatra project based on mobile-html5-boilerplate, Erb or Haml templating, Compass for styles and Coffeescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published