endymion-origami 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.textile +138 -0
- data/Rakefile +39 -0
- data/app/helpers/layout_helper.rb +44 -0
- data/app/views/layouts/1_column_em.html.erb +110 -0
- data/app/views/layouts/1_column_percentage.html.erb +127 -0
- data/app/views/layouts/1_column_pixel.html.erb +110 -0
- data/app/views/layouts/2_column_left_menu_em.html.erb +209 -0
- data/app/views/layouts/2_column_left_menu_percentage.html.erb +181 -0
- data/app/views/layouts/2_column_left_menu_pixel.html.erb +216 -0
- data/app/views/layouts/2_column_right_menu_em.html.erb +204 -0
- data/app/views/layouts/2_column_right_menu_percentage.html.erb +227 -0
- data/app/views/layouts/2_column_right_menu_pixel.html.erb +240 -0
- data/app/views/layouts/3_column_blog_em.html.erb +257 -0
- data/app/views/layouts/3_column_blog_percentage.html.erb +255 -0
- data/app/views/layouts/3_column_blog_pixel.html.erb +268 -0
- data/app/views/layouts/3_column_holy_grail_em.html.erb +262 -0
- data/app/views/layouts/3_column_holy_grail_percentage.html.erb +255 -0
- data/app/views/layouts/3_column_holy_grail_pixel.html.erb +262 -0
- data/app/views/layouts/_body.html.erb +7 -0
- data/app/views/layouts/_column_1.html.erb +5 -0
- data/app/views/layouts/_column_2.html.erb +5 -0
- data/app/views/layouts/_column_3.html.erb +5 -0
- data/app/views/layouts/_flashes.html.erb +15 -0
- data/app/views/layouts/_footer.html.erb +5 -0
- data/app/views/layouts/_google_analytics_tracker.html.erb +8 -0
- data/app/views/layouts/_head.html.erb +23 -0
- data/app/views/layouts/_header.html.erb +5 -0
- data/app/views/layouts/_image_replacement.html.erb +3 -0
- data/app/views/layouts/_javascript_includes.html.erb +1 -0
- data/app/views/layouts/_layout_and_theme_stylesheets.html.erb +8 -0
- data/app/views/layouts/stacked_columns.html.erb +418 -0
- data/assets/bluetrip-css-framework/LICENSE +312 -0
- data/assets/bluetrip-css-framework/README.rst +37 -0
- data/assets/bluetrip-css-framework/css/ie.css +21 -0
- data/assets/bluetrip-css-framework/css/print.css +49 -0
- data/assets/bluetrip-css-framework/css/screen.css +409 -0
- data/assets/bluetrip-css-framework/css/style.css +7 -0
- data/assets/bluetrip-css-framework/examples/grid.html +232 -0
- data/assets/bluetrip-css-framework/examples/index.html +263 -0
- data/assets/bluetrip-css-framework/examples/test-small.jpg +0 -0
- data/assets/bluetrip-css-framework/img/grid.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/cross.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/doc.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/email.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/external.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/feed.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/im.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/information.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/key.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/pdf.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/tick.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/visited.png +0 -0
- data/assets/bluetrip-css-framework/img/icons/xls.png +0 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/chaise.rb +9 -0
- data/origami.gemspec +118 -0
- data/public/stylesheets/1_column_em.css +117 -0
- data/public/stylesheets/1_column_percentage.css +134 -0
- data/public/stylesheets/1_column_pixel.css +117 -0
- data/public/stylesheets/2_column_left_menu_em.css +149 -0
- data/public/stylesheets/2_column_left_menu_percentage.css +142 -0
- data/public/stylesheets/2_column_left_menu_pixel.css +149 -0
- data/public/stylesheets/2_column_right_menu_em.css +148 -0
- data/public/stylesheets/2_column_right_menu_percentage.css +142 -0
- data/public/stylesheets/2_column_right_menu_pixel.css +148 -0
- data/public/stylesheets/3_column_blog_pixel.css +162 -0
- data/rails/init.rb +1 -0
- data/rdoc/classes/ApplicationController.html +151 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_textile.html +363 -0
- data/rdoc/files/lib/chaise_rb.html +101 -0
- data/rdoc/fr_class_index.html +27 -0
- data/rdoc/fr_file_index.html +28 -0
- data/rdoc/fr_method_index.html +27 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/tasks/chaise_tasks.rake +15 -0
- data/test/chaise_test.rb +26 -0
- data/test/test_helper.rb +3 -0
- data/uninstall.rb +1 -0
- metadata +136 -0
data/rails/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ActionView::Base.send :include, LayoutHelper
|
@@ -0,0 +1,151 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: ApplicationController</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">ApplicationController</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/chaise_rb.html">
|
59
|
+
lib/chaise.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
ActionController::Base
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000001">render</a>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if includes -->
|
97
|
+
|
98
|
+
<div id="section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
<div id="methods">
|
109
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
110
|
+
|
111
|
+
<div id="method-M000001" class="method-detail">
|
112
|
+
<a name="M000001"></a>
|
113
|
+
|
114
|
+
<div class="method-heading">
|
115
|
+
<a href="#M000001" class="method-signature">
|
116
|
+
<span class="method-name">render</span><span class="method-args">(options = {}, extra_options = {}, &block)</span>
|
117
|
+
</a>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="method-description">
|
121
|
+
<p>
|
122
|
+
Override <a href="ApplicationController.html#M000001">render</a> so that it
|
123
|
+
will look for a layout setting.
|
124
|
+
</p>
|
125
|
+
<p><a class="source-toggle" href="#"
|
126
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
127
|
+
<div class="method-source-code" id="M000001-source">
|
128
|
+
<pre>
|
129
|
+
<span class="ruby-comment cmt"># File lib/chaise.rb, line 4</span>
|
130
|
+
4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>(<span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">extra_options</span> = {}, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
131
|
+
5: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">:layout</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@layout</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@layout</span>.<span class="ruby-identifier">nil?</span>
|
132
|
+
6: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">extra_options</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
133
|
+
7: <span class="ruby-keyword kw">end</span>
|
134
|
+
</pre>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
<div id="validator-badges">
|
147
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</body>
|
151
|
+
</html>
|
data/rdoc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Mon, 11 May 2009 11:25:39 -0400
|
@@ -0,0 +1,363 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: README.textile</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>README.textile</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README.textile
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon May 11 11:25:14 -0400 2009</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
h1. Origami
|
74
|
+
</p>
|
75
|
+
<p>
|
76
|
+
A Rails Engine plugin that handles the tedious parts of setting up HTML/CSS
|
77
|
+
layouts. Developing Rails apps is a very high-level pursuit, but at some
|
78
|
+
point you have to code an HTML layout and styling for your web
|
79
|
+
applications. That can be pretty tedious unless you have A Way. There is no
|
80
|
+
One True Way to lay out a web page, any more than there is One True Way to
|
81
|
+
watch a sunset. But Origami is a nice way.
|
82
|
+
</p>
|
83
|
+
<p>
|
84
|
+
h2. The Problem
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
Properly coding an HTML layout is a pain in the neck. You have to put down
|
88
|
+
your beautiful high-level Ruby code to deal with ugliness like:
|
89
|
+
</p>
|
90
|
+
<pre>
|
91
|
+
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
92
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
93
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></code></pre>
|
94
|
+
</pre>
|
95
|
+
<p>
|
96
|
+
Code like this is important, but it‘s clutter that disrupts your
|
97
|
+
thought processes. Apply Feng Shui to your application and get the clutter
|
98
|
+
out of sight.
|
99
|
+
</p>
|
100
|
+
<p>
|
101
|
+
h2. The Solution
|
102
|
+
</p>
|
103
|
+
<p>
|
104
|
+
In your controller:
|
105
|
+
</p>
|
106
|
+
<pre>
|
107
|
+
layout '2_column_left_menu_pixel'
|
108
|
+
</pre>
|
109
|
+
<p>
|
110
|
+
In your views:
|
111
|
+
</p>
|
112
|
+
<pre>
|
113
|
+
Blah blah blah the body of your view automatically goes in "column_1", which
|
114
|
+
will always be at the top of the HTML file and other columns will always
|
115
|
+
come after it.
|
116
|
+
<% content_for :column_2 do %>
|
117
|
+
Put something here.
|
118
|
+
<% end %>
|
119
|
+
</pre>
|
120
|
+
<p>
|
121
|
+
Origami does the rest. It wraps your page body in the necessary divs,
|
122
|
+
calculates the necessary styles, and applies them using
|
123
|
+
app/views/layouts/application.rb. You get validating HTML code that works
|
124
|
+
in any browser and you don‘t have to think about HTML or CSS. You
|
125
|
+
focus on your application instead.
|
126
|
+
</p>
|
127
|
+
<p>
|
128
|
+
h2. Features
|
129
|
+
</p>
|
130
|
+
<p>
|
131
|
+
h3. Blueprint
|
132
|
+
</p>
|
133
|
+
<p>
|
134
|
+
Sensible CSS defaults from "BlueTrip":<a
|
135
|
+
href="http://bluetrip.org">bluetrip.org</a>
|
136
|
+
</p>
|
137
|
+
<p>
|
138
|
+
h3. Matthew James Taylor templates
|
139
|
+
</p>
|
140
|
+
<p>
|
141
|
+
Origami uses HTML/CSS layouts by "Matthew James Taylor":<a
|
142
|
+
href="http://matthewjamestaylor.com">matthewjamestaylor.com</a>/ which have
|
143
|
+
many features:
|
144
|
+
</p>
|
145
|
+
<p>
|
146
|
+
h3. No CSS Hacks
|
147
|
+
</p>
|
148
|
+
<p>
|
149
|
+
The CSS used for the layouts in Origami are 100% valid and hack free. To
|
150
|
+
overcome Internet Explorer‘s broken box model, no horizontal padding
|
151
|
+
or margins are used. Instead, this design uses percentage widths and clever
|
152
|
+
relative positioning.
|
153
|
+
</p>
|
154
|
+
<p>
|
155
|
+
h3. SEO friendly 2-1 column ordering
|
156
|
+
</p>
|
157
|
+
<p>
|
158
|
+
The higher up content is in your page code, the more important it is
|
159
|
+
considered by search engine algorithms. To make your website as optimised
|
160
|
+
as possible your main page content must come before the side columns. This
|
161
|
+
layout does exactly that: The the right-hand main page comes first, then
|
162
|
+
the left column (see the nested div structure diagram for more info). The
|
163
|
+
columns can also be configured in the opposite order if required.
|
164
|
+
</p>
|
165
|
+
<p>
|
166
|
+
h3. Full length column background colours
|
167
|
+
</p>
|
168
|
+
<p>
|
169
|
+
In this layout the background colours of each column will always stretch to
|
170
|
+
the length of the longest column. This feature was traditionally only
|
171
|
+
available with table based layouts but now with a little CSS trickery we
|
172
|
+
can do exactly the same with divs. Say goodbye to annoying short columns!
|
173
|
+
</p>
|
174
|
+
<p>
|
175
|
+
h3. No Images
|
176
|
+
</p>
|
177
|
+
<p>
|
178
|
+
This layout requires no images. Many CSS website designs need images to
|
179
|
+
colour in the column backgrounds but that is not necessary with this
|
180
|
+
design. Why waste bandwidth and precious HTTP requests when you can do
|
181
|
+
everything in pure CSS and XHTML?
|
182
|
+
</p>
|
183
|
+
<p>
|
184
|
+
h3. No JavaScript
|
185
|
+
</p>
|
186
|
+
<p>
|
187
|
+
JavaScript is not required. Some website layouts rely on JavaScript hacks
|
188
|
+
to resize divs and force elements into place but you won‘t see any of
|
189
|
+
that nonsense here.
|
190
|
+
</p>
|
191
|
+
<p>
|
192
|
+
h3. Resizable text compatible
|
193
|
+
</p>
|
194
|
+
<p>
|
195
|
+
This layout is fully compatible with resizable text. Resizable text is
|
196
|
+
important for web accessibility. People who are vision impaired can make
|
197
|
+
the text larger so it‘s easier for them to read. It is becoming
|
198
|
+
increasingly more important to make your website resizable text compatible
|
199
|
+
because people are expecting higher levels of web accessibility. Apple have
|
200
|
+
made resizing the text on a website simple with the pinch gesture on their
|
201
|
+
multi-touch trackpad. So far this trackpad is only available on the MacBook
|
202
|
+
Air but it will soon be rolled out to all of their systems. Is your website
|
203
|
+
text-resizing compatible?
|
204
|
+
</p>
|
205
|
+
<p>
|
206
|
+
h3. No Quirks Mode
|
207
|
+
</p>
|
208
|
+
<p>
|
209
|
+
This liquid layout does not require the XML declaration for it to display
|
210
|
+
correctly in older versions of Internet Explorer. This version works
|
211
|
+
without it and is thus never in quirks mode.
|
212
|
+
</p>
|
213
|
+
<p>
|
214
|
+
h3. No IE Conditional Comments
|
215
|
+
</p>
|
216
|
+
<p>
|
217
|
+
Only one stylesheet is used with this layout This means that IE conditional
|
218
|
+
comments are not needed to set extra CSS rules for older versions of
|
219
|
+
Internet Explorer. This also means that ActivePackager can compress and
|
220
|
+
consolidate the styles without breaking them.
|
221
|
+
</p>
|
222
|
+
<p>
|
223
|
+
h3. Browser Compatibility
|
224
|
+
</p>
|
225
|
+
<p>
|
226
|
+
This left menu liquid Layout has been tested on the following browsers:
|
227
|
+
</p>
|
228
|
+
<ul>
|
229
|
+
<li>iPhone & iPod Touch
|
230
|
+
|
231
|
+
</li>
|
232
|
+
</ul>
|
233
|
+
<p>
|
234
|
+
** Safari
|
235
|
+
</p>
|
236
|
+
<ul>
|
237
|
+
<li>Mac
|
238
|
+
|
239
|
+
</li>
|
240
|
+
</ul>
|
241
|
+
<p>
|
242
|
+
** Safari ** Firefox ** Opera 9.25 ** Netscape 9.0.0.5 & 7.1
|
243
|
+
</p>
|
244
|
+
<ul>
|
245
|
+
<li>Windows
|
246
|
+
|
247
|
+
</li>
|
248
|
+
</ul>
|
249
|
+
<p>
|
250
|
+
** Firefox 1.5, 2 & 3 ** Safari ** Opera 8.1 & 9 ** Google Chrome
|
251
|
+
** Explorer 5.5, 6 & 7 ** Netscape 8
|
252
|
+
</p>
|
253
|
+
<p>
|
254
|
+
h3. Valid XHTML strict markup
|
255
|
+
</p>
|
256
|
+
<p>
|
257
|
+
The HTML in this layout validates as XHTML 1.0 strict.
|
258
|
+
</p>
|
259
|
+
<p>
|
260
|
+
h2. Customize
|
261
|
+
</p>
|
262
|
+
<p>
|
263
|
+
You can override any of the templates in the app/views/layouts folder in
|
264
|
+
Origami. For example, if you‘re particular about your HTML DTD or
|
265
|
+
something then copy the app/views/layouts/_head.html.erb file to your
|
266
|
+
application and change it. Rails 2.3 will use your template instead of the
|
267
|
+
one from Origami.
|
268
|
+
</p>
|
269
|
+
<p>
|
270
|
+
If you‘re in a hurry then you might rather just customize the page
|
271
|
+
title and a few other things using environment.rb constants:
|
272
|
+
</p>
|
273
|
+
<pre>
|
274
|
+
TITLE = 'Your Web Site Title Here'
|
275
|
+
DESCRIPTION = 'Your meta description tag.' # Optional.
|
276
|
+
KEYWORDS = 'Your, Keywords, Here' # Optional.
|
277
|
+
ICON = 'http://you/your/shortcut/icon.gif'
|
278
|
+
THEME = 'blue' # Style sheet theme name. # Optional.
|
279
|
+
WIDTH = '980px' # The overall page width, as a CSS value. ie: '980px', '100%', '100em'
|
280
|
+
</pre>
|
281
|
+
<p>
|
282
|
+
h2. Optional
|
283
|
+
</p>
|
284
|
+
<p>
|
285
|
+
Google Analytics snippets are a common enough layout element that you can
|
286
|
+
generate one automatically by just setting your Google Analytics account
|
287
|
+
code in your environment.rb:
|
288
|
+
</p>
|
289
|
+
<pre>
|
290
|
+
GOOGLE_ANALYTICS_ACCOUNT = 'UA-376????-?'
|
291
|
+
</pre>
|
292
|
+
<p>
|
293
|
+
h2. Engine
|
294
|
+
</p>
|
295
|
+
<p>
|
296
|
+
Origami is a Rails engine. It works with versions of Rails greater than
|
297
|
+
2.3. It will not work with previous version of Rails because they will not
|
298
|
+
import the layout templates from app/views/layouts in Origami. It may be
|
299
|
+
possible to make Origami work with the Rails Engine plugin, but currently
|
300
|
+
it only works with Rails 2.3.
|
301
|
+
</p>
|
302
|
+
<p>
|
303
|
+
h2. Install
|
304
|
+
</p>
|
305
|
+
<p>
|
306
|
+
Do this for now:
|
307
|
+
</p>
|
308
|
+
<pre>
|
309
|
+
script/plugin install http://github.com/endymion/origami/tree/master
|
310
|
+
</pre>
|
311
|
+
<p>
|
312
|
+
This is how I‘m trying to get it to work but I‘m currently
|
313
|
+
having problems making Origami available as a Ruby Gem:
|
314
|
+
</p>
|
315
|
+
<p>
|
316
|
+
In config/environment.rb:
|
317
|
+
</p>
|
318
|
+
<pre>
|
319
|
+
config.gem "endymion-origami",
|
320
|
+
:lib => 'origami',
|
321
|
+
:source => 'http://gems.github.com',
|
322
|
+
:version => '>=0.1.0'
|
323
|
+
</pre>
|
324
|
+
<p>
|
325
|
+
Vendor the gem:
|
326
|
+
</p>
|
327
|
+
<pre>
|
328
|
+
rake gems:install
|
329
|
+
rake gems:unpack
|
330
|
+
</pre>
|
331
|
+
|
332
|
+
</div>
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
<!-- if includes -->
|
342
|
+
|
343
|
+
<div id="section">
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
<!-- if method_list -->
|
353
|
+
|
354
|
+
|
355
|
+
</div>
|
356
|
+
|
357
|
+
|
358
|
+
<div id="validator-badges">
|
359
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
</body>
|
363
|
+
</html>
|