These are chat archives for jescalan/roots

5th
Nov 2015
Steve Sunderland
@stevesunderland
Nov 05 2015 03:45
hey guys, does anyone have any tips on creating a multilingual site using roots + contentful? I can't find anything in the docs.
Andy Shora
@andyshora
Nov 05 2015 10:30
Anyone successfully minify SASS using the CSS Pipeline?
My output when I set minify: true: [object Object]
Ah, solution was to upgrade: carrot/roots-css-pipeline#10
Damian Phillips-king
@imdpk
Nov 05 2015 15:50
Has anyone successfully used nunjucks js templating engine with roots?
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 16:39
You can probably work up an extension for integrating nunjucks @imdpk.
Damian Phillips-king
@imdpk
Nov 05 2015 16:46
Thanks for the response
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 19:29
Is anyone using babel with roots?
Jeff Escalante
@jescalan
Nov 05 2015 20:52
@sethkrasnianski thanks for helping to debug this issue. you are my boy :fist:
you can use babel by just installing it and using a .jsx extension for a file
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 20:53
:thumbsup:
Jeff Escalante
@jescalan
Nov 05 2015 20:53
i'm currently plotting on ways to make this easier. base the workflow more around babel, postcss, webpack kind of stuff
i'll get back here to you guys once i have anything significant :wink:
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 20:54
can’t use it with .js files?
Jeff Escalante
@jescalan
Nov 05 2015 20:54
future release will also let you just use js and process it with babel once installed
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 20:54
nice
Jeff Escalante
@jescalan
Nov 05 2015 20:54
we have the update in place for this i just need to polish and release
i will have that update on the browsersync branch soon, if you are using that one by any chance
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 21:12
No i have not used that branch yet. I’ll take a peek though
Jeff Escalante
@jescalan
Nov 05 2015 21:14
some people are using it as it has some stability improvements, i just havent had a chance to do final polish and tests and get it released bc i was in africa with no internet for like a month haha
i promise once im actually working full time this whole thing will be significantly more professional
im back in the us in february, for the record
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 21:21
no worries. enjoy your world travelling adventure. does that branch use babel first like you mentioned or is that something that you’re intending to implement into that release
or a realease after that one
Jeff Escalante
@jescalan
Nov 05 2015 21:32
no it doesnt yet but i will have it merged into that branch soon
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 21:32
:thumbsup:
Jeff Escalante
@jescalan
Nov 05 2015 21:32
the next time i have a day that i can get work done
i'll let you know. for now just add an "x" and itll do the trick haha
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 21:33
heh sounds good. I’ll try that out in a bit. I appreciate the help
Damian Phillips-king
@imdpk
Nov 05 2015 21:36
I am trying to add nunjucks to as an extensions but running into issues
is it as easy as adding with module.exports and adding to extension or do I have to create an extension
Damian Phillips-king
@imdpk
Nov 05 2015 21:48

EXTENSION ERROR!

It looks like there was a Malformed Extension Error.
Check out http://roots.cx/errors#125 for more help

Reason: Extension must return a function/class

axis = require 'axis'
rupture = require 'rupture'
autoprefixer = require 'autoprefixer-stylus'
js_pipeline = require 'js-pipeline'
css_pipeline = require 'css-pipeline'
roots_contentful = require 'roots-contentful'
nunjucks = module.require('nunjucks')

module.exports =
ignores: ['readme.md', '/layout.*', '/_', '.gitignore', 'ship.conf', 'nunjucks.js']

extensions: [
nunjucks.configure('views', { autoescape: true })

console.log(nunjucks.renderString('Hello {{ username }}', { username: 'James' }))

js_pipeline(files: 'assets/js/*.js')
css_pipeline(files: 'assets/css/*.styl')
roots_contentful(
  access_token: '42e2ef119e47d1bb3e1afc63476c1e5e2fd39cfe57cad771913081965e13374d'
  space_id: 'mef1666geih9'
  content_types:
    clients:
      id: '2XzUIMoKS4waGA8U4SKswA'
      write: 'data.json'
)

]

stylus:
use: [axis(), rupture(), autoprefixer()]
sourcemap: true

'coffee-script':
sourcemap: true

jade:
pretty: true

Seth Krasnianski
@sethkrasnianski
Nov 05 2015 21:49
you actually need to make a roots extension
can’t just drop it in there arbitrarily.
other option is to integrate roots with gulp and have nunjucks run separately
if you don’t want to develop a roots extension
Damian Phillips-king
@imdpk
Nov 05 2015 21:53
good to know
thanks
Seth Krasnianski
@sethkrasnianski
Nov 05 2015 22:00
but it would probably be helpful in the future and for others to make an extension
check out the guide