These are chat archives for jescalan/roots

18th
Feb 2016
pauljakobwhite
@pauljakobwhite
Feb 18 2016 17:38
Hey folks, random question, I'm trying to set up a roots project to use for designing html emails. Anyone have any thoughts of how to add inline CSS to the jade "pipeline" (i.e. taking the compiled css and adding it as inline css to the compiled html)? Is this possible?
pcaleja
@pcaleja
Feb 18 2016 18:02
Hello, been playing around with roots and love the flow it has. I really want to implement it for the company blog I work for but they have a good 800 posts currently and I’ve been reading that the compile time of roots gets really slow the more posts you have. I’m aware that this is being addressed for the new version of roots but for the interim, what’s the approximate compile time of a site with about 1000 - 1500 posts?
Adam Argyle
@argyleink
Feb 18 2016 18:21
@jenius totally, the authors are currently maintaining their own yaml file, but I’d like to take a collection of yaml files and compile them against a layout.jade file, to create author detail pages. Not sure how to recreate the “posts” behavior with authors.
Jeff Escalante
@jescalan
Feb 18 2016 19:31
@pauljakobwhite you could do this with a roots extension. I feel like at one point @kylemac was working on one?
@pcaleja man for 1000+ posts right now you'd be looking easily at over 5 minutes. you can use this extension to speed it up in development though: https://www.npmjs.com/package/roots-ignore
@argyleink i think you would need an extension for this, it's a very customized behavior
Adam Argyle
@argyleink
Feb 18 2016 19:45
agreed, i’d need to build a custom extension. i need the task to be part of the roots pipeline
thx for the confirmation, i’ll scope it out for the client
Mathias Biilmann
@biilmann
Feb 18 2016 19:52
@argyleink I think the roots-collections plugin could easily be modified to read yaml files as well as markdown files based on extension
Adam Argyle
@argyleink
Feb 18 2016 20:28
totally, if i move forward making an extension, i’ll be forking roots-collections, it’s pretty close to what we need
heres a folder of yaml, render it against this layout to this directory. boom.
Mathias Biilmann
@biilmann
Feb 18 2016 20:49
right now it actually just takes a folder and then tries to read any file in that folder as markdown with yaml frontmatter
would be happy for a pull request that changed the read_file function here:
to be aware of formats
probably just have a small list of formatters by extensions
format = {md: markdownFormatter, markdown: markdownFormatter, yml: yamlFormatter, json: jsonFormatter}
and then just do something like:
formatter = formas[fileExtension]
pcaleja
@pcaleja
Feb 18 2016 20:52
@jenius Thanks! 5 mins doesn’t sound so bad but I’ll definitely checkout that extension.
Mathias Biilmann
@biilmann
Feb 18 2016 20:52
if (formatter) { return formatter(file) } else { raise “No formatter for #{fileExtension}” }