How to transfer partial parts to partial intermediaries

I have some partial parts of Haml, many of which contain patterns

.container .row .col-lg-12

When I try to abstract from ala = partial "site_section" , I get:

 syntax error, unexpected keyword_end, expecting end-of-input end;end;end;end 

I am using ruby โ€‹โ€‹2.2.2.

How to edit a partial part of Haml in a partial part of Haml in Middleman?

thanks

Update This seems to be some special case regarding my partial (above). I have other partial partial partial renderings that are just fine.

Update As far as this repo is concerned, it will actually be:

_site_section:

.container .row .col-lg-12

_nested_section:

 = partial "site_section" MOAR (nested) HAML 

index.haml:

=partial "nested_section"

+7
ruby templates partials haml middleman
source share
1 answer

Due to how HAML works, the following is not allowed:

 = partial "site_section" MOAR (nested) HAML 

If you want to add more text or HAML, you can achieve it, for example, by placing the text at the same level as the previous line

 = partial "site_section" MOAR (nested) HAML 

Or nested in a div:

 = partial "site_section" .more MOAR (nested) HAML 

So, if you are trying to embed an additional HAML in the output file part_section partial, then you should put the nested additional HAML in the nested partial:

 .container .row .col-lg-12 = partial 'nested_stuff' = partial 'nested_stuff' 

Hope this helps, I updated the repository with a working example .

+1
source share

All Articles