I've tried prepending content_for with =, == or - without luck :)
index.slim
- content_for(:senarios) do
h1 Some content
layout.slim
== yield_content(:senarios)
Hope somebody got a solution.
I've tried prepending content_for with =, == or - without luck :)
index.slim
- content_for(:senarios) do
h1 Some content
layout.slim
== yield_content(:senarios)
Hope somebody got a solution.
The example should work fine.
You capture content with content_for
and insert it in the layout file with yield_content
. You can omit the parentheses if you want.
If you use standard Slim settings you need two equal signs. Otherwise the output will be escaped and you will see <h1>Some content</h1>
instead of Some content
in the rendered output.
I also use this with Middleman and Slim. No issues. Can you please provide more code, errors, etc.?
The only thing which is looking suspicious is the filename index.slim. It should be index.html.slim.
I met same problem, and solved it.
You should change
- content_for(:eyecatch) do
to
= content_for(:eyecatch) do
nested html attributes should no longer be duplicated.