Partials
========
A partial is a snippet of code that you can reuse in any page of your site.
This is particularly useful for repetitive sections, and for sections that may
make your files too large to manage.
Creating partials
-----------------
Put your partial file anywhere in the `layouts` folder, e.g.:
In your site's files, you can invoke a partial through:
Partial:
<%= partial 'shared/sidebar' %>
End of partial.
This is now text from index.html.
This will output:
Partial:
End of partial.
This is now text from index.html.
Partials with local variables
-----------------------------
You can define a partial with some local variables that will be passed
to it by the caller.
In your files, call a partial by:
<%= partial 'shared/product', { :name => '5MP Camera CX-300', :description => 'This is a camera with an adjustable focal length and Bluetooth support.' } %>
Partials in HAML files
----------------------
HAML support in Hyde has the `escape_html` option on by default. You
will need to use `!= partial` instead of `= partial`.
-# Don't forget the exclamation point!
!= partial 'shared/product'
If you omit the `!`, the partial will be rendered with it's HTML code
escaped.