These are chat archives for jescalan/roots

2nd
Feb 2016
Giovanni Collazo
@gcollazo
Feb 02 2016 02:41
is there any example using handlebars views?
Declan de Wet
@declandewet
Feb 02 2016 08:42
@djeglin You might want to use the Contentful search API, which roots-contentful supports via the filters option on each content type
I think you might be able to do this by adding to your content type:
filters:
   'fields.category[exists]': true
while you may also use boolean logic to filter out invalid entries, this method is better as you won't receive any extraneous payloads over the wire
mattymaloney
@mattymaloney
Feb 02 2016 11:51
Has anyone used roots with slm (https://github.com/slm-lang/slm), the javascript port of Slim?
PeteStein
@PeteStein
Feb 02 2016 15:35
Somewhat new to roots, trying to hook into the content that roots-contentful is pulling out. Is it normal for a module to call directly to a compiler/renderFile? How is roots, or any other roots module, supposed to review what roots-contentful is adding to the site, and perhaps do pre-/post-processing on that content?
Giovanni Collazo
@gcollazo
Feb 02 2016 20:00
Hello everyone... when can I find an example or maybe documentation on how to replace jade with another templating language... I want to use handlebars, mustache or ejs
Steve Babigian
@k00k
Feb 02 2016 20:09
@gcollazo you should be able to just: npm install jade and then name your template file with a .jade extension
sorry, npm install <someothertemplatelanguage>
so like, npm install ejs and name your file like: welcome.ejs
Declan de Wet
@declandewet
Feb 02 2016 20:49

@PeteStein To partially answer your question regarding how Roots extensions can access locals set by other extensions, it depends on a number of things. Roots has a documented extension interface. It largely depends on which event hooks the extension uses internally (setup is used mostly for grabbing data, after_pass is used after each compile pass on a file as one file can be compiled multiple times, and after_file is used once, after the file has compiled) and whether or not the ordered property is set internally by the extension (and thereby the order in which extensions are listed in your app.coffee). I can't really explain it in full detail as I'm learning all of this myself, so if you have more questions, @jenius should be the one to ask.

That being said, as the new maintainer of roots-contentful, the current version only makes use of the setup hook, so this kind of interoperability is not yet possible without hacky workarounds. We are working hard on a new release for roots-contentful written in ES2015, with a few performance improvements (caching, memoization), new features (like support for multiple locales and being able to reference _urls on linked entries) but one very important goal is interoperability with roots-yaml and roots-records. My hope is that the research, work and experimentation on this particular feature will open doors for interop with more than just those two extensions.

If you wish to look at the aforementioned "hacky workaround" : carrot/roots-contentful#31

PeteStein
@PeteStein
Feb 02 2016 20:50
Thanks, @declandewet!
Giovanni Collazo
@gcollazo
Feb 02 2016 21:34
thanks @k00k I wanted to know how to load partials and helpers... ended up writing some utility functions for doing just that https://gist.github.com/gcollazo/12b194f51c1a266692ef
will share the whole thing later because it took me some time to figure out, not obvious
Giovanni Collazo
@gcollazo
Feb 02 2016 22:10
Steve Babigian
@k00k
Feb 02 2016 23:12
@gcollazo I think it gets set by the js_pipeline module