Skip to content

Instantly share code, notes, and snippets.

@billymeltdown
Created May 26, 2010 16:43
Show Gist options
  • Save billymeltdown/414725 to your computer and use it in GitHub Desktop.
Save billymeltdown/414725 to your computer and use it in GitHub Desktop.
- content_hash[:header] = capture_haml do
:textile
h1(strip). About Strip
p(intro). Credits & Copyrights
Thank you for your interest in Strip! This page contains legal information and serves to give credit where credit is due.
/ main content
:textile
h3. SQLCipher - Encryption
Strip's encryption engine, "SQLCipher":/software/sqlcipher, is a free and open source variant of "SQLite":http://www.sqlite.org, the popular embedded database engine. SQLCipher uses OpenSSL to provide transparent, page-level encryption. SQLCipher is © 2008-2009 Zetetic LLC, all rights reserved, and is also free and open source software.
!!!
%html
%head
= stylesheets
%body
#header
= yield_for(:header)
#content
= yield
module SiteHelper
attr_accessor :content_hash
def content_hash
@content_hash ||= {}
end
def yield_for(index)
output = self.content_hash[index.to_sym]
output = "" if output.nil?
output
end
end
@billymeltdown
Copy link
Author

Method for faking Rails' content_for helper and the use of yield with varying symbols to yield alternative content in a staticmatic layout document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment