Skip to content

Instantly share code, notes, and snippets.

@seth-macpherson
Forked from minikomi/mobilehtml5.haml
Created October 14, 2011 06:18
Show Gist options
  • Save seth-macpherson/1286381 to your computer and use it in GitHub Desktop.
Save seth-macpherson/1286381 to your computer and use it in GitHub Desktop.
mobile html5 boilerplate haml
<!doctype html>
/[if IEMobile 7 ] <html class="no-js iem7">
/ [if (gt IEMobile 7)|!(IEMobile)]><!
%html.no-js
/ <![endif]
%head
%meta{:charset => "utf-8"}
%title
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
%meta{:content => "True", :name => "HandheldFriendly"}
%meta{:content => "320", :name => "MobileOptimized"}
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
/ %link{:href => "img/h/apple-touch-icon.png", :rel => "apple-touch-icon-precomposed", :sizes => "114x114"}
/ %link{:href => "img/m/apple-touch-icon.png", :rel => "apple-touch-icon-precomposed", :sizes => "72x72"}
/ %link{:href => "img/l/apple-touch-icon-precomposed.png", :rel => "apple-touch-icon-precomposed"}
/ %link{:href => "img/l/apple-touch-icon.png", :rel => "shortcut icon"}
%meta{:content => "black", :name => "apple-mobile-web-app-status-bar-style"}
:javascript
(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone") %link{:href => "img/l/splash.png", :rel => "apple-touch-startup-image"}
/ %link{:href => "img/l/splash.png", :rel => "apple-touch-startup-image"}
%meta{:content => "on", "http-equiv" => "cleartype"}
= javascript_include_tag 'modernizr/modernizr-custom'
= render :template => "layouts/_stylesheets.html.haml"
:javascript
Modernizr.mq('(min-width:0)') || document.write('\x3C/script>')
%body
#container
%header
#main{:role => "main"}
= yield
%footer
-# Javascript at the bottom for fast page loading
= render :template => 'layouts/_javascripts.html.haml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment