/
layout.coffee
75 lines (58 loc) · 2.6 KB
/
layout.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
doctype 5
# paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
ie "lt IE 7", ->
html class: "no-js ie6", lang: "en"
ie "IE 7", ->
html class: "no-js ie7", lang: "en"
ie "IE 8", ->
html class: "no-js ie8", lang: "en"
ie "gt IE 8", ->
text """<!--> <html class="no-js" lang="en"> <!--"""
head ->
meta charset: "utf-8"
meta "http-equiv": "X-UA-Compatible", content: "IE=Edge;chrome=1"
title @title or "yoursite.com"
meta name: "description", content: ""
meta name: "author", content: ""
meta name: "viewport", content: "width=980"
# HTML5 shim, for IE 6-8 support of HTML elements
ie "lt IE 9", ->
script src: "http://html5shim.googlecode.com/svn/trunk/html5.js"
link rel: "stylesheet", href: "/css/bootstrap.min.css"
link rel: "stylesheet/less", href: "/css/main.less"
# Use less.js to compile 'stylesheet/less' files.
script src: "//cdnjs.cloudflare.com/ajax/libs/less.js/1.1.3/less-1.1.3.min.js"
coffeescript ->
window.less or document.write('<script src="/js/libs/less-1.1.3.min.js">\x3C/script>')
link rel: "shortcut icon", href: "/favicon.ico"
link rel: "apple-touch-icon", href: "/apple-touch-icon.png"
link rel: "apple-touch-icon", sizes: "72x72", href: "/apple-touch-icon-72x72.png"
link rel: "apple-touch-icon", sizes: "114x114", href: "/apple-touch-icon-114x114.png"
# Need Modernizr? Uncomment the following script.
# script src:"/js/libs/modernizr-2.0.6.js"
body ->
header ->
partial "header"
div "#main", role: "main", ->
@body
footer @footer
# JavaScript at the bottom for fast page loading.
# Grab Google CDN's jQuery, with a protocol relative URL.
script src: "//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"
coffeescript ->
window.jQuery or document.write('<script src="/js/libs/jquery-1.6.4.min.js">\x3C/script>')
# Additional JavaScript libraries and plugins...
script src: "/js/libs/bootstrap-dropdown.js"
# mathiasbynens.be/notes/async-analytics-snippet
# Change UA-XXXXX-X to be your site's Google Analytics ID.
script type: "text/javascript", -> """
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
"""
# Prompt IE 6-7 users to install Chrome Frame.
ie "lte IE 7", ->
script src: "//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"
coffeescript ->
window.attachEvent('onload', -> CFInstall.check(mode: 'overlay'))