staticmatic 0.8.10 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,71 +1,77 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
- <head>
4
- <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
5
- <title>StaticMatic</title>
6
- <link media="all" href="/stylesheets/application.css" rel="stylesheet"/>
7
- </head>
8
- <body>
9
- <div id='container'>
10
- <div id='header'>
11
- <div class='bycurve21'>
12
- <a href="http://www.curve21.com"><img alt="/images/bycurve21" src="/images/bycurve21.gif"/>
13
- </a>
14
- </div>
15
- <div class='title'>StaticMatic</div>
16
- </div>
17
- <div id='menu'>
18
- <ul>
19
- <li><a href="/">Home</a></li>
20
- <li><a href="/download.html">Download</a></li>
21
- <li><a href="/how_to_use.html">How to use</a></li>
22
- <li>
23
- <a href="http://rubyforge.org/projects/staticmatic">Development</a>
24
- </li>
25
- <li>
26
- <a href="http://groups.google.co.uk/group/staticmatic">Community</a>
27
- </li>
28
- <li><a href="/faq.html">FAQ</a></li>
29
- </ul>
30
- </div>
31
- <div id='content_wrapper'>
32
- <div id='side'>
33
- <div id='news'>
34
- <div class='heading'>News</div>
35
- <div class='title'>0.8.8 Released!</div>
36
- <p>
37
- Complete with:
38
- </p>
39
- <ul>
40
- <li>Helpers</li>
41
- <li>Configuration</li>
42
- </ul>
43
- <a href="/releases/0_8_8.html">And More!</a>
44
- </div>
45
- </div>
46
- <div id='content'>
47
- <h1>FAQ</h1>
48
- <h3>
49
- I hate Haml. Can I use a different template language?
50
- </h3>
51
- <p>
52
- No. At least not at the moment. Haml is perfect for our needs so we've had no reason to investigate using other languages. However, StaticMatic is open source so patches are always welcome.
53
- </p>
54
- </div>
55
- </div>
56
- <div id='footer'>
57
- <p>
58
- Made with StaticMatic, Hosted by
59
- <a href="http://rubyforge.org">RubyForge</a>
60
- </p>
61
- </div>
62
- <script src='http://www.google-analytics.com/urchin.js' type='text/javascript'>
63
- _hamlspace = "";
64
- </script>
65
- <script type='text/javascript'>
66
- _uacct = "UA-775359-8";
67
- urchinTracker();
68
- </script>
69
- </div>
70
- </body>
71
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
5
+ <title>StaticMatic</title>
6
+ <link href="stylesheets/application.css" media="all" rel="stylesheet"/>
7
+ <link href="stylesheets/application.css" media="screen" rel="stylesheet"/>
8
+ </head>
9
+ <body>
10
+ <div id='container'>
11
+ <div id='header'>
12
+ <div class='bycurve21'>
13
+ <a href="http://www.curve21.com"><img alt="Bycurve21" src="images/bycurve21.gif"/></a>
14
+ </div>
15
+ <div class='title'>StaticMatic</div>
16
+ </div>
17
+ <div id='menu'>
18
+ <ul>
19
+ <li><a href="/">Home</a></li>
20
+ <li><a href="download.html">Download</a></li>
21
+ <li><a href="how_to_use.html">How to use</a></li>
22
+ <li>
23
+ <a href="http://groups.google.co.uk/group/staticmatic">Community</a>
24
+ </li>
25
+ <li><a href="faq.html">FAQ</a></li>
26
+ <li>
27
+ <a href="http://rubyforge.org/tracker/?func=browse&amp;group_id=3712&amp;atid=14306">Report Bug</a>
28
+ </li>
29
+ <li>
30
+ <a href="http://rubyforge.org/projects/staticmatic">Development</a>
31
+ </li>
32
+ </ul>
33
+ </div>
34
+ <div id='content_wrapper'>
35
+ <div id='side'>
36
+ <div id='news'>
37
+ <div class='heading'>News</div>
38
+ <div class='title'>0.9.0 Released!</div>
39
+ <p>Complete with:</p>
40
+ <ul>
41
+ <li>&quot;Local&quot; links are always relative</li>
42
+ <li>
43
+ Ability to strip .html and index.html from link tag urls
44
+ </li>
45
+ <li>configuration.sass_options</li>
46
+ </ul>
47
+ <a href="/releases/0_9_0.html">And More!</a>
48
+ </div>
49
+ </div>
50
+ <div id='content'>
51
+ <h1>FAQ</h1>
52
+ <h3>
53
+ I hate Haml. Can I use a different template language?
54
+ </h3>
55
+ <p>
56
+ No. At least not at the moment. Haml is perfect for our needs so we've had no reason to investigate using other languages. However, StaticMatic is open source so patches are always welcome.
57
+ </p>
58
+ </div>
59
+ </div>
60
+ <div id='footer'>
61
+ <p>
62
+ Made with StaticMatic
63
+ 0.9.0
64
+ , Hosted by
65
+ <a href="http://rubyforge.org">RubyForge</a>
66
+ </p>
67
+ </div>
68
+ <script src='http://www.google-analytics.com/urchin.js' type='text/javascript'>
69
+ _hamlspace = "";
70
+ </script>
71
+ <script type='text/javascript'>
72
+ _uacct = "UA-775359-8";
73
+ urchinTracker();
74
+ </script>
75
+ </div>
76
+ </body>
77
+ </html>
@@ -1,173 +1,307 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
- <head>
4
- <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
5
- <title>StaticMatic</title>
6
- <link media="all" href="/stylesheets/application.css" rel="stylesheet"/>
7
- </head>
8
- <body>
9
- <div id='container'>
10
- <div id='header'>
11
- <div class='bycurve21'>
12
- <a href="http://www.curve21.com"><img alt="/images/bycurve21" src="/images/bycurve21.gif"/>
13
- </a>
14
- </div>
15
- <div class='title'>StaticMatic</div>
16
- </div>
17
- <div id='menu'>
18
- <ul>
19
- <li><a href="/">Home</a></li>
20
- <li><a href="/download.html">Download</a></li>
21
- <li><a href="/how_to_use.html">How to use</a></li>
22
- <li>
23
- <a href="http://rubyforge.org/projects/staticmatic">Development</a>
24
- </li>
25
- <li>
26
- <a href="http://groups.google.co.uk/group/staticmatic">Community</a>
27
- </li>
28
- <li><a href="/faq.html">FAQ</a></li>
29
- </ul>
30
- </div>
31
- <div id='content_wrapper'>
32
- <div id='side'>
33
- <div id='news'>
34
- <div class='heading'>News</div>
35
- <div class='title'>0.8.8 Released!</div>
36
- <p>
37
- Complete with:
38
- </p>
39
- <ul>
40
- <li>Helpers</li>
41
- <li>Configuration</li>
42
- </ul>
43
- <a href="/releases/0_8_8.html">And More!</a>
44
- </div>
45
- </div>
46
- <div id='content'>
47
- <h1>How to Use</h1>
48
- <p>
49
- StaticMatic is very easy to work with. It aims to provide just the tools you need and not get in your way.
50
- </p>
51
- <ul>
52
- <li><a href="#developing">Developing a site</a></li>
53
- <li>
54
- <a href="#templates">Templates</a>
55
- <ul>
56
- <li><a href="#layouts">Layouts</a></li>
57
- <li><a href="#helpers">Helpers</a></li>
58
- </ul>
59
- </li>
60
- </ul>
61
- <h2 id='developing'>Developing a site with StaticMatic</h2>
62
- <h3>Setting up a site</h3>
63
- <p>
64
- The first thing to do with a StaticMatic site is to set up the folders and files ready for use. A simple command will create everything you need to get started:
65
- </p>
66
- <div class='code'>staticmatic setup my_site</div>
67
- <p>This will set up a number of directories:</p>
68
- <ul>
69
- <li>
70
- site/ - contains your static site and any assets such as images or javascript files
71
- </li>
72
- <li>
73
- src/ - where you'll work on your templates
74
- <ul>
75
- <li>
76
- layouts/ - contains templates that 'wrap' your main content pages
77
- </li>
78
- <li>pages/ - contains the actual pages of content</li>
79
- <li>
80
- stylesheets/ - contains any Sass stylesheets you want to create
81
- </li>
82
- </ul>
83
- </li>
84
- </ul>
85
- <h3>Previewing your site</h3>
86
- <p>
87
- When you're ready to start working on your site, you can fire up the preview server to see your changes:
88
- </p>
89
- <div class='code'>staticmatic preview my_site</div>
90
- <p>
91
- This will start a web server on port 3000. Point your web browser to
92
- <a href="http://localhost:3000">http://localhost:3000</a>
93
- to see your site.
94
- </p>
95
- <h3>Building your site</h3>
96
- <p>
97
- When you're happy with the website, you can tell StaticMatic to generate the HTML pages:
98
- </p>
99
- <div class='code'>staticmatic build my_site</div>
100
- <h2 id='templates'>Templates</h2>
101
- <p>
102
- <em>
103
- For information on how to use Haml itself, please check out the
104
- <a href="http://haml.hamptoncatlin.com/docs/haml">Haml website</a>
105
- .
106
- </em>
107
- </p>
108
- <h3 id='layouts'>Layouts</h3>
109
- <p>
110
- As with web frameworks like
111
- <a href="http://www.rubyonrails.com">Ruby on Rails</a>
112
- , StaticMatic uses layouts to 'wrap' up the content contained within page templates.
113
- </p>
114
- <p>
115
- A layout typically contains the header and footer code for a page - code that is common to all pages on the site.
116
- </p>
117
- <p>
118
- The only thing a layout *must* contain is a line that tells StaticMatic where to put the content:
119
- </p>
120
- <div class='code'>= yield</div>
121
- <p>
122
- By default, StaticMatic will look for a template named 'application.haml'. If you have a page that needs to use a different layout, this can be specified in the page itself:
123
- </p>
124
- <em>contact_us.haml:</em>
125
- <div class='code'>- @layout = "contact"</div>
126
- <p>
127
- The above code would tell StaticMatic to use the layout called 'contact.haml' when building and previewing the 'contact_us' page.
128
- </p>
129
- <h3 id='helpers'>
130
- </h3>
131
- <p>
132
- StaticMatic provides a number of 'helpers' on top of those in Haml to handle common code and reduce code.
133
- </p>
134
- <h4>Links</h4>
135
- <p>
136
- 'link' can automatically set up hyperlinks for you:
137
- </p>
138
- <div class='code'>= link "Contact Us"</div>
139
- produces:
140
- <div class='code'>
141
- &lt;a href="contact_us.html"&gt;Contact Us&lt;/a&gt;"
142
- </div>
143
- <p>You can also specify a URL:</p>
144
- <div class='code'>
145
- = link "StaticMatic", "http://staticmatic.rubyforge.org"
146
- </div>
147
- <h4>Images</h4>
148
- <div class='code'>= img "me.jpg"</div>
149
- produces:
150
- <div class='code'>&lt;img src="/images/me.jpg"/&gt;</div>
151
- <h4>Stylesheets</h4>
152
- <div class='code'>= stylesheets</div>
153
- <p>
154
- This will automatically insert links to any Sass stylesheets in your site source.
155
- </p>
156
- </div>
157
- </div>
158
- <div id='footer'>
159
- <p>
160
- Made with StaticMatic, Hosted by
161
- <a href="http://rubyforge.org">RubyForge</a>
162
- </p>
163
- </div>
164
- <script src='http://www.google-analytics.com/urchin.js' type='text/javascript'>
165
- _hamlspace = "";
166
- </script>
167
- <script type='text/javascript'>
168
- _uacct = "UA-775359-8";
169
- urchinTracker();
170
- </script>
171
- </div>
172
- </body>
173
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
5
+ <title>StaticMatic</title>
6
+ <link href="stylesheets/application.css" media="all" rel="stylesheet"/>
7
+ <link href="stylesheets/application.css" media="screen" rel="stylesheet"/>
8
+ </head>
9
+ <body>
10
+ <div id='container'>
11
+ <div id='header'>
12
+ <div class='bycurve21'>
13
+ <a href="http://www.curve21.com"><img alt="Bycurve21" src="images/bycurve21.gif"/></a>
14
+ </div>
15
+ <div class='title'>StaticMatic</div>
16
+ </div>
17
+ <div id='menu'>
18
+ <ul>
19
+ <li><a href="/">Home</a></li>
20
+ <li><a href="download.html">Download</a></li>
21
+ <li><a href="how_to_use.html">How to use</a></li>
22
+ <li>
23
+ <a href="http://groups.google.co.uk/group/staticmatic">Community</a>
24
+ </li>
25
+ <li><a href="faq.html">FAQ</a></li>
26
+ <li>
27
+ <a href="http://rubyforge.org/tracker/?func=browse&amp;group_id=3712&amp;atid=14306">Report Bug</a>
28
+ </li>
29
+ <li>
30
+ <a href="http://rubyforge.org/projects/staticmatic">Development</a>
31
+ </li>
32
+ </ul>
33
+ </div>
34
+ <div id='content_wrapper'>
35
+ <div id='side'>
36
+ <div id='news'>
37
+ <div class='heading'>News</div>
38
+ <div class='title'>0.9.0 Released!</div>
39
+ <p>Complete with:</p>
40
+ <ul>
41
+ <li>&quot;Local&quot; links are always relative</li>
42
+ <li>
43
+ Ability to strip .html and index.html from link tag urls
44
+ </li>
45
+ <li>configuration.sass_options</li>
46
+ </ul>
47
+ <a href="/releases/0_9_0.html">And More!</a>
48
+ </div>
49
+ </div>
50
+ <div id='content'>
51
+ <h1>How to Use</h1>
52
+ <p>
53
+ StaticMatic is very easy to work with. It aims to provide just the tools you need and not get in your way.
54
+ </p>
55
+ <ul>
56
+ <li><a href="#developing">Developing a site</a></li>
57
+ <li><a href="#configuration">Configuration</a></li>
58
+ <li>
59
+ <a href="#templates">Templates</a>
60
+ <ul>
61
+ <li><a href="#layouts">Layouts</a></li>
62
+ <li><a href="#helpers">Helpers</a></li>
63
+ <li><a href="#partials">Partials</a></li>
64
+ </ul>
65
+ </li>
66
+ </ul>
67
+ <h2 id='developing'>Developing a site with StaticMatic</h2>
68
+ <h3>Setting up a site</h3>
69
+ <p>
70
+ The first thing to do with a StaticMatic site is to set up the folders and files ready for use. A simple command will create everything you need to get started:
71
+ </p>
72
+ <div class='code'>staticmatic setup my_site</div>
73
+ <p>This will set up a number of directories:</p>
74
+ <ul>
75
+ <li>
76
+ site/ - contains your static site and any assets such as images or javascript files
77
+ </li>
78
+ <li>
79
+ src/ - where you'll work on your templates
80
+ <ul>
81
+ <li>
82
+ helpers/ - contains any helpers you want to use in your website
83
+ </li>
84
+ <li>
85
+ layouts/ - contains templates that 'wrap' your main content pages
86
+ </li>
87
+ <li>pages/ - contains the actual pages of content</li>
88
+ <li>
89
+ partials/ - contains any &quot;partial pages&quot; that can be reused in other pages or layouts
90
+ </li>
91
+ <li>
92
+ stylesheets/ - contains any
93
+ <a href="http://haml.hamptoncatlin.com/docs/sass">Sass</a>
94
+ stylesheets you want to create
95
+ </li>
96
+ </ul>
97
+ </li>
98
+ </ul>
99
+ <h3>Previewing your site</h3>
100
+ <p>
101
+ When you're ready to start working on your site, you can fire up the preview server to see your changes:
102
+ </p>
103
+ <div class='code'>staticmatic preview my_site</div>
104
+ <p>
105
+ This will start a web server on port 3000. Point your web browser to
106
+ <a href="http://localhost:3000">http://localhost:3000</a>
107
+ to see your site.
108
+ </p>
109
+ <h3>Building your site</h3>
110
+ <p>
111
+ When you're happy with the website, you can tell StaticMatic to generate the HTML pages:
112
+ </p>
113
+ <div class='code'>staticmatic build my_site</div>
114
+ <h2 id='configuration'>Configuration</h2>
115
+ <p>
116
+ You can put a file called configuration.rb in your staticmatic project base directory.
117
+ In this file, you can set configuration settings or whatever else since it's just a
118
+ ruby file.
119
+ </p>
120
+ <h3>configuration.preview_server_port</h3>
121
+ <p>
122
+ The default is 3000.
123
+ </p>
124
+ <h3>configuration.preview_server_host</h3>
125
+ <p>
126
+ The default is localhost.
127
+ </p>
128
+ <h3>configuration.use_extensions_for_page_links</h3>
129
+ <p>
130
+ The default is true. When false .html and index.html will be stripped off
131
+ urls generated by the link tag helper.
132
+ </p>
133
+ <h3>configuration.sass_options</h3>
134
+ <p>
135
+ Default is an empty hash. You can specify any options that
136
+ <a href="http://haml.hamptoncatlin.com/docs/sass">Sass</a>
137
+ can take like :style => :compact
138
+ </p>
139
+ <h2 id='templates'>Templates</h2>
140
+ <p>
141
+ <em>
142
+ For information on how to use Haml itself, please check out the
143
+ <a href="http://haml.hamptoncatlin.com/docs/haml">Haml website</a>.
144
+ </em>
145
+ </p>
146
+ <h3 id='layouts'>Layouts</h3>
147
+ <p>
148
+ As with web frameworks like
149
+ <a href="http://www.rubyonrails.com">Ruby on Rails</a>,
150
+ StaticMatic uses layouts to 'wrap' up the content contained within page templates.
151
+ </p>
152
+ <p>
153
+ A layout typically contains the header and footer code for a page - code that is common to all pages on the site.
154
+ </p>
155
+ <p>
156
+ The only thing a layout *must* contain is a line that tells StaticMatic where to put the content:
157
+ </p>
158
+ <div class='code'>= yield</div>
159
+ <p>
160
+ By default, StaticMatic will look for a template named 'application.haml'. If you have a page that needs to use a different layout, this can be specified in the page itself:
161
+ </p>
162
+ <em>contact_us.haml:</em>
163
+ <div class='code'>- @layout = "contact"</div>
164
+ <p>
165
+ The above code would tell StaticMatic to use the layout called 'contact.haml' when building and previewing the 'contact_us' page.
166
+ </p>
167
+ <h3 id='helpers'>Helpers</h3>
168
+ <p>
169
+ StaticMatic provides a number of 'helpers' on top of those in Haml to handle common code and reduce code.
170
+ </p>
171
+ <h4>Links</h4>
172
+ <p>
173
+ 'link' can automatically set up hyperlinks for you:
174
+ </p>
175
+ <div class='code'>= link "Contact Us"</div>
176
+ produces:
177
+ <div class='code'>
178
+ &lt;a href="contact_us.html"&gt;Contact Us&lt;/a&gt;"
179
+ </div>
180
+ <p>
181
+ It is also possible to specify a relative path in your url:
182
+ </p>
183
+ <div class='code'>= link "../Contact Us"</div>
184
+ produces:
185
+ <div class='code'>
186
+ &lt;a href="../contact_us.html"&gt;Contact Us&lt;/a&gt;"
187
+ </div>
188
+ <p>You can also specify a URL:</p>
189
+ <div class='code'>
190
+ = link "StaticMatic", "http://staticmatic.rubyforge.org"
191
+ </div>
192
+ <h4>Images</h4>
193
+ <div class='code'>= img "me.jpg"</div>
194
+ produces:
195
+ <div class='code'>&lt;img src="/images/me.jpg"/&gt;</div>
196
+ <p>
197
+ It is also possible to specify a relative path in your url:
198
+ </p>
199
+ <div class='code'>= img "../me.jpg"</div>
200
+ produces:
201
+ <div class='code'>&lt;img src="../me.jpg"/&gt;</div>
202
+ <h4>Stylesheets</h4>
203
+ <div class='code'>= stylesheets</div>
204
+ <p>
205
+ This will automatically insert links to any
206
+ <a href="http://haml.hamptoncatlin.com/docs/sass">Sass</a>
207
+ stylesheets in your site source.
208
+ It will also link up any static stylesheets in your site/stylesheets/ directory
209
+ </p>
210
+ <p>
211
+ You can also specify the files and the order explicitly along with setting attributes:
212
+ </p>
213
+ <div class='code'>
214
+ = stylesheets :reset, :application, :media => :screen
215
+ </div>
216
+ produces
217
+ <div class='code'>
218
+ &lt;link href=&quot;stylesheets/reset.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot;/&gt;
219
+ <br />
220
+ &lt;link href=&quot;stylesheets/application.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot;/&gt;
221
+ </div>
222
+ <h4>Javascript</h4>
223
+ <div class='code'>= javascripts('test', :other)</div>
224
+ produces:
225
+ <div class='code'>
226
+ &lt;script language=&quot;javascript&quot; src=&quot;/javascripts/test.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
227
+ <br />
228
+ &lt;script language=&quot;javascript&quot; src=&quot;/javascripts/other.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
229
+ </div>
230
+ <h4>Current page</h4>
231
+ <p>
232
+ It can be very useful to know what page you're on in your layout and helpers
233
+ (ie: setting selected style on a menu item).
234
+ </p>
235
+ For the page src/pages/index.html
236
+ <div class='code'>= current_page # =&gt; &quot;/index.html&quot;</div>
237
+ <br />
238
+ For the page src/pages/subdirectory/other.html
239
+ <div class='code'>
240
+ = current_page # =&gt; &quot;/subdirectory/other.html&quot;
241
+ </div>
242
+ <h4>urlify</h4>
243
+ <p>Will convert a string to be usable in a url</p>
244
+ <div class='code'>
245
+ = urlify(&quot;We love Haml&quot;) # =&gt; &quot;we_love_haml&quot;
246
+ <br />
247
+ = urlify(&quot;Elf &amp; Ham&quot;) # =&gt; &quot;elf_and_ham&quot;
248
+ <br />
249
+ = urlify(&quot;Stephen's gem&quot;) # =&gt; &quot;stephens_gem&quot;
250
+ <br />
251
+ = urlify(&quot;Test/Link&quot;) # =&gt; &quot;testlink&quot;
252
+ </div>
253
+ <h4>text_field</h4>
254
+ <p>Generates a text input field</p>
255
+ <div class='code'>= text_field('first_name', 'bob')</div>
256
+ produces:
257
+ <div class='code'>
258
+ &lt;input name=&quot;first_name&quot; type=&quot;text&quot; value=&quot;bob&quot;/&gt;
259
+ </div>
260
+ <h3 id='partials'>Partials</h3>
261
+ <p>
262
+ As with web frameworks like
263
+ <a href="http://www.rubyonrails.com">Ruby on Rails</a>,
264
+ StaticMatic uses partials to keep things
265
+ <a href="http://en.wikipedia.org/wiki/DRY">DRY</a>.
266
+ </p>
267
+ <div class='code'>= partial('mypartial')</div>
268
+ <p>
269
+ This will first look in the current page/partial's directory for a file called _mypartial.haml.
270
+ If not found there it will look for src/partials/mypartial.haml.
271
+ </p>
272
+ <h4>Specify the partial's local variables</h4>
273
+ <div class='code'>
274
+ = partial('mypartial', :locals => { :title => 'My Title' })
275
+ </div>
276
+ <p>
277
+ This will locate the partial file as in the previous example above but now passes in a local variable called
278
+ <em>title</em>
279
+ that can be used in the partial like so:
280
+ </p>
281
+ <div class='code'>%h1 title</div>
282
+ <h4>Specify the partial's directory</h4>
283
+ <div class='code'>= partial('shared/mypartial')</div>
284
+ <p>
285
+ This will look for the file src/pages/shared/_mypartial.haml first.
286
+ If not found there it will look for src/partials/mypartial.haml.
287
+ </p>
288
+ </div>
289
+ </div>
290
+ <div id='footer'>
291
+ <p>
292
+ Made with StaticMatic
293
+ 0.9.0
294
+ , Hosted by
295
+ <a href="http://rubyforge.org">RubyForge</a>
296
+ </p>
297
+ </div>
298
+ <script src='http://www.google-analytics.com/urchin.js' type='text/javascript'>
299
+ _hamlspace = "";
300
+ </script>
301
+ <script type='text/javascript'>
302
+ _uacct = "UA-775359-8";
303
+ urchinTracker();
304
+ </script>
305
+ </div>
306
+ </body>
307
+ </html>