bridgetownrb / bridgetown-haml

A Bridgetown plugin which provides support for Haml templates.
MIT License
3 stars 1 forks source link

Partials in `src/_components` folder aren't used #1

Closed ariel-codes closed 1 year ago

ariel-codes commented 3 years ago

Hi! Just trying out Bridgetown for the first time and hit a (very minor, really) roadblock:

If you take the default site generated by bridgetown new, and bundle add bridgetown-haml -g bridgetown_plugins then convert the layouts to *.haml files, you will get an error regarding the render references to the head, navbar and footer components, which are in the src/_components folder but this plugin only searches site.config[:partials_dir].

How can this be fixed/changed/circumvented? Besides just renaming _components => _partials, since that seems to kinda defeat the idea of separate components and partials folders...

jaredcwhite commented 2 years ago

@ariel-codes I realize I'm responding outrageously late on this — I apologize! I think the answer to this is two-fold:

(a) If you're referring to Liquid components, you can use the liquid_render helper

(b) Otherwise, now you can use Ruby components directly from your Haml templates, and those can also use Haml or any of the other supported Bridgetown template engines.