├── .gitignore ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ └── javascripts │ │ ├── application.js │ │ └── polyfills.js └── views │ ├── application │ ├── _chromeframe.html.erb │ ├── _flashes.html.erb │ ├── _footer.html.erb │ ├── _head.html.erb │ ├── _header.html.erb │ ├── _javascripts.html.erb │ └── _stylesheets.html.erb │ └── layouts │ └── application.html.erb ├── html5-rails.gemspec ├── lib ├── generators │ └── html5 │ │ ├── assets │ │ ├── USAGE │ │ ├── assets_generator.rb │ │ └── templates │ │ │ ├── javascripts │ │ │ ├── application.js │ │ │ └── polyfills.js │ │ │ └── stylesheets │ │ │ └── application │ │ │ ├── index.css.scss │ │ │ ├── layout.css.scss │ │ │ ├── media_queries.css.scss │ │ │ └── variables.css.scss │ │ ├── generator_helpers.rb │ │ ├── install │ │ ├── USAGE │ │ ├── install_generator.rb │ │ └── templates │ │ │ ├── README │ │ │ └── config │ │ │ ├── compass.rb │ │ │ └── html5_rails.yml │ │ ├── layout │ │ ├── USAGE │ │ ├── layout_generator.rb │ │ └── templates │ │ │ ├── application.html.erb │ │ │ ├── application.html.haml │ │ │ └── application.html.slim │ │ └── partial │ │ ├── USAGE │ │ ├── partial_generator.rb │ │ └── templates │ │ ├── _chromeframe.html.erb │ │ ├── _chromeframe.html.haml │ │ ├── _chromeframe.html.slim │ │ ├── _flashes.html.erb │ │ ├── _flashes.html.haml │ │ ├── _flashes.html.slim │ │ ├── _footer.html.erb │ │ ├── _footer.html.haml │ │ ├── _footer.html.slim │ │ ├── _head.html.erb │ │ ├── _head.html.haml │ │ ├── _head.html.slim │ │ ├── _header.html.erb │ │ ├── _header.html.haml │ │ ├── _header.html.slim │ │ ├── _javascripts.html.erb │ │ ├── _javascripts.html.haml │ │ ├── _javascripts.html.slim │ │ ├── _stylesheets.html.erb │ │ ├── _stylesheets.html.haml │ │ └── _stylesheets.html.slim ├── html5-rails.rb └── html5 │ ├── rails.rb │ └── rails │ ├── engine.rb │ ├── helpers.rb │ └── version.rb ├── test ├── dummy │ ├── .gitignore │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── rails.png │ │ │ ├── javascripts │ │ │ │ ├── application.js │ │ │ │ └── pages.js.coffee │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ └── pages_controller.rb │ │ ├── helpers │ │ │ ├── application_helper.rb │ │ │ └── pages_helper.rb │ │ ├── mailers │ │ │ └── .gitkeep │ │ ├── models │ │ │ └── .gitkeep │ │ └── views │ │ │ ├── layouts │ │ │ └── application.html.erb │ │ │ └── pages │ │ │ └── home.html.erb │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── backtrace_silencers.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── secret_token.rb │ │ │ ├── session_store.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ └── routes.rb │ ├── db │ │ └── seeds.rb │ ├── doc │ │ └── README_FOR_APP │ ├── lib │ │ ├── assets │ │ │ └── .gitkeep │ │ └── tasks │ │ │ └── .gitkeep │ ├── log │ │ └── .gitkeep │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── favicon.ico │ │ └── robots.txt │ ├── script │ │ └── rails │ └── vendor │ │ ├── assets │ │ ├── javascripts │ │ │ └── .gitkeep │ │ └── stylesheets │ │ │ └── .gitkeep │ │ └── plugins │ │ └── .gitkeep ├── generators │ ├── assets_generator_test.rb │ ├── install_generator_test.rb │ ├── layout_generator_test.rb │ └── partial_generator_test.rb ├── html5_rails_test.rb ├── integration │ └── navigation_test.rb ├── support │ ├── generator_test_helper.rb │ └── integration_case.rb └── test_helper.rb └── vendor └── assets └── javascripts ├── h5bp.js └── modernizr.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | .bundle 3 | Gemfile.lock 4 | pkg/* 5 | test/tmp 6 | vendor/bundle 7 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | gemspec 4 | 5 | gem 'rails', '3.2.13' 6 | 7 | # Bundle edge Rails instead: 8 | # gem 'rails', :git => 'git://github.com/rails/rails.git' 9 | 10 | gem 'sqlite3' 11 | 12 | 13 | # Gems used only for assets and not required 14 | # in production environments by default. 15 | group :assets do 16 | gem 'sass-rails', '~> 3.2.3' 17 | gem 'coffee-rails', '~> 3.2.1' 18 | gem 'uglifier', '>= 1.0.3' 19 | gem 'compass-rails' 20 | gem 'compass-h5bp', :path => '../compass-h5bp' 21 | end 22 | 23 | gem 'jquery-rails' 24 | gem 'haml-rails' 25 | gem 'slim-rails' 26 | 27 | # To use debugger 28 | # gem 'ruby-debug19', :require => 'ruby-debug' 29 | 30 | group :test do 31 | # Pretty printed test output 32 | gem 'turn', :require => false 33 | gem 'capybara' 34 | end 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Peter Gumeson 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Html5 for Rails 2 | ========================= 3 | 4 | Html5 for Rails projects based on [Html5 Boilerplate](http://html5boilerplate.com) 5 | by Paul Irish, Divya Manian and many other [fine folks](https://github.com/h5bp/html5-boilerplate/contributors). 6 | 7 | Installation 8 | ========================= 9 | 10 | ##### 1. In your Gemfile 11 | 12 | ```ruby 13 | group :assets do 14 | gem 'sass-rails' 15 | gem 'coffee-rails' 16 | gem 'uglifier' 17 | 18 | gem 'compass-h5bp' 19 | end 20 | 21 | gem 'jquery-rails' 22 | gem 'html5-rails' 23 | 24 | # Optional: to generate haml 25 | # gem 'haml-rails' 26 | 27 | # Optional: to generate slim 28 | # gem 'slim-rails' 29 | ``` 30 | 31 | ##### 2. Install your bundle 32 | 33 | ``` 34 | $ bundle install 35 | ``` 36 | 37 | ##### 3. Run the generator 38 | 39 | ``` 40 | $ rails generate html5:install 41 | ``` 42 | 43 | ##### (Here's what it does) 44 | 45 | create config/compass.rb 46 | create config/html5_rails.yml 47 | create app/views/layouts/application.html.(erb|haml|slim) 48 | create app/views/application 49 | create app/views/application/_footer.html.(erb|haml|slim) 50 | create app/views/application/_head.html.(erb|haml|slim) 51 | create app/views/application/_header.html.(erb|haml|slim) 52 | create app/views/application/_chromeframe.html.(erb|haml|slim) 53 | exist app/assets/javascripts 54 | insert app/assets/javascripts/application.js 55 | gsub app/assets/javascripts/application.js 56 | create app/assets/javascripts/polyfills.js 57 | remove app/assets/stylesheets/application.css 58 | create app/assets/stylesheets/application 59 | create app/assets/stylesheets/application/index.css.scss 60 | create app/assets/stylesheets/application/variables.css.scss 61 | create app/assets/stylesheets/application/layout.css.scss 62 | create app/assets/stylesheets/application/media_queries.css.scss 63 | 64 | ##### 4. And you're done! 65 | 66 | rails server 67 | 68 | 69 | Options 70 | ========================= 71 | 72 | To see other generators available run: 73 | 74 | ``` 75 | $ rails generate html5:layout --help 76 | $ rails generate html5:partial --help 77 | $ rails generate html5:assets --help 78 | ``` 79 | 80 | Google Analytics 81 | ========================= 82 | 83 | By default your Google Analytics code snippet will be hidden until you set your Google Account ID. 84 | You can do this by either setting `ENV['GOOGLE_ACCOUNT_ID']` or `google_account_id` in config/html5_rails.yml. 85 | 86 | Notes 87 | ========== 88 | 89 | [1] The `compass-h5bp` gem is not a runtime dependency, but it does need to be 90 | included in your assets group for development and asset precompiling to work. 91 | 92 | [2] If you use `--template-engine=haml` (or `haml-rails` gem), the install 93 | generator will prompt to remove your application.html.erb layout so that 94 | application.html.haml will be used instead. 95 | 96 | [3] For the time being, you will want to add the following line to 97 | config/production.rb so that polyfills are precompiled on deploy: 98 | 99 | `config.assets.precompile += %w( polyfills.js )` 100 | 101 | 102 | License 103 | ======== 104 | 105 | Copyright (c) 2010-2013 Peter Gumeson. 106 | See [LICENSE](https://github.com/sporkd/html5-rails/blob/master/LICENSE) for full license. 107 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | require 'rake/testtask' 3 | 4 | Rake::TestTask.new(:test) do |t| 5 | t.libs << 'lib' 6 | t.libs << 'test' 7 | t.pattern = 'test/**/*_test.rb' 8 | t.verbose = true 9 | end 10 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into including all the files listed below. 2 | // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 3 | // be included in the compiled file accessible from http://example.com/assets/application.js 4 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 5 | // the compiled file. 6 | // 7 | //= require jquery 8 | //= require jquery_ujs 9 | //= require h5bp 10 | -------------------------------------------------------------------------------- /app/assets/javascripts/polyfills.js: -------------------------------------------------------------------------------- 1 | // This is a manifest for javascript polyfills that will be included 2 | // in the head section of your layouts. 3 | // 4 | // polyfill (n): a JavaScript shim that replicates the standard API for older browsers. 5 | // 6 | //= require modernizr.min 7 | -------------------------------------------------------------------------------- /app/views/application/_chromeframe.html.erb: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /app/views/application/_flashes.html.erb: -------------------------------------------------------------------------------- 1 |
<%= value %>
5 |