These are chat archives for jescalan/roots

22nd
Jan 2015
John Peele
@johnpeele
Jan 22 2015 15:29
hey guys quick v3 question - i would like to use locals to store a common <title> for my templates. it doesn't seem to work the same in v3... help?
Chad Martinson
@ChadMartinson
Jan 22 2015 16:46
@jenius yeah I plan on using an api but I would also like to use routes for some basic navigation. If that makes sense.
Jeff Escalante
@jescalan
Jan 22 2015 16:54
hey @johnpeele -- you can use locals in the same way, just use locals in your app.coffee file
and hi chad!
so there are a couple ways to hook up roots with APIs
depending on how you want to split out your content rendering between js and static
If you check out the last 2 videos on http://roots.netlify.com there is an overview of some of the ways you can do this
basically, you will need a client-side mv* framework like backbone, ember, or angular
we humbly recommend backbone/marionette
John Peele
@johnpeele
Jan 22 2015 16:56
@jenius here is what i have in app.coffee
module.exports =
  ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf']

  extensions: [
    js_pipeline(files: 'assets/js/*.coffee'),
    css_pipeline(files: 'assets/css/*.styl')
  ]

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

  'coffee-script':
    sourcemap: true

  jade:
    pretty: true

  locals:
    title: 'This is my title'
Chad Martinson
@ChadMartinson
Jan 22 2015 16:57
yeah, my plan was to use backbone, I am more familiar with it.
Jeff Escalante
@jescalan
Jan 22 2015 16:57
chad: for client-side routing, you'll want to redirect all routes to your index. Then you can use backbone's router to handle it
in development, you can get this redirect behavior by adding server: { spa: true } to app.coffee
in production you have to set it up according to your host
John Peele
@johnpeele
Jan 22 2015 16:57
and then in my layout.jade = title= title
Jeff Escalante
@jescalan
Jan 22 2015 16:58
that looks good to me john
i've done the same thing in a number of sites. you're saying this isn't working?
John Peele
@johnpeele
Jan 22 2015 16:58
that's what i thought... not working in v3
for me anyway ;)
i get empty title tags <title></title
Jeff Escalante
@jescalan
Jan 22 2015 16:59
testing now
John Peele
@johnpeele
Jan 22 2015 16:59
that is how i did it in all my other v2 sites
Jeff Escalante
@jescalan
Jan 22 2015 16:59
working perfectly
just tested on a brand new v3 site
perhaps something else is up with your config
could you link me to the source?
John Peele
@johnpeele
Jan 22 2015 17:00
yikes, let me push to a repo real quick for ya
Jeff Escalante
@jescalan
Jan 22 2015 17:01
@johnpeele here is a working sample project: http://cl.ly/ZPWE
@ChadMartinson: We're planning on releasing a roots template for backbone/marionette that will have the right basic setup for all these utilities
I will let you know when it's out
but we have made a number of roots sites with backbone and they work smoothly
If there's anything specific we can help with let me know!
I'd estimate that the backbone roots template will be out before the end of next week
also roots v3 is shipping today guys :tada:
as stable
let me look at your sample project
Jeff Escalante
@jescalan
Jan 22 2015 17:03
it's just the default template with locals added
Chad Martinson
@ChadMartinson
Jan 22 2015 17:03
is there a repo I can look at for help in integrating backbone. I need a prototype this weekend and I would really love to use roots
Jeff Escalante
@jescalan
Jan 22 2015 17:03
this weekend! damn
i mean, this is not a roots issue, its a backbone issue
if you don't understand how to use backbone, it's going to be hard to get this working by this weekend no matter what
you are basically just asking me to write you a backbone foundation for free
i'll do my best but I do have a lot of other things on my plate at the moment so I can't absolutely promise it before this weekend
I'm going to see if I can get some help for you here from the roots team
Chad Martinson
@ChadMartinson
Jan 22 2015 17:07
Sorry, that was not my intent. I don't want you to do that. I have other ways to make this prototype. I just thought it would be fun. I can totally wait for the template to use on other projects. Please accept my apologies.
Jeff Escalante
@jescalan
Jan 22 2015 17:14
hah its ok. i mean if you want to make a backbone project you'll have to do the same work either way whether you use roots or not
is what i was trying to get across
roots has no special handling or tie-in with any client-side js
Chad Martinson
@ChadMartinson
Jan 22 2015 17:19
oh so I can just include the library and start using it out of the box?
Jeff Escalante
@jescalan
Jan 22 2015 17:19
yup
Chad Martinson
@ChadMartinson
Jan 22 2015 17:20
I have been using meteor where everything is packaged and needs a wrapper. how refreshing. :)
Jeff Escalante
@jescalan
Jan 22 2015 17:20
hah yeah roots is like the opposite of that
Chad Martinson
@ChadMartinson
Jan 22 2015 17:20
That makes it even sweeter. Thanks for all the hard work.
Jeff Escalante
@jescalan
Jan 22 2015 17:27
it's just static sites only
no bundles, no tie-in with anything else
i think you'l find it to be pretty refreshing coming out of a full-stack framework
we transitioned from rails to this split API/front-end architecture and it's been huge amounts better for us