-
-
Save bithavoc/bf46d844995977f949cb6f9fa3fac0e4 to your computer and use it in GitHub Desktop.
Inline asset helpers for middleman.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AssetHelper | |
## | |
# Renders a stylesheet asset inline. | |
def inline_stylesheet( name ) | |
content_tag :style do | |
sprockets[ "#{name}.css" ].to_s | |
end | |
end | |
## | |
# Renders a javascript asset inline. | |
def inline_javascript( name ) | |
content_tag :script do | |
sprockets[ "#{name}.js" ].to_s | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html{ html_attrs } | |
%head | |
= inline_stylesheet 'application' | |
= inline_javascript 'application' | |
/ ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment