These are chat archives for jescalan/roots

16th
Jun 2016
Perry Kibler
@javaporter
Jun 16 2016 00:49

@tkraak @jescalan a while ago (few days?) we were all chatting about an issue with body classes and Cannot read property 'match' of undefined. I finally made the time to look into it, because body(class= _path.match(/(\w+)\.html$/)[1]) works just fine with the basic roots installed site. I ended up adding one line at a time to see where the issue was. Tequila helped.

The culprit, in my case, and probably yours @tkraak, was the part in roots-contentful where you define your template. So, for me, commenting out template: 'views/_post.jade' fixed the issue.

So, I'm getting closer now. @jescalan, have you seen this?

In other news, @biilmann, Netlify is compiling roots in ~30 seconds. HOLY BUCKETS THAT'S FAST!
middleman-contentful is a lot longer. If there were no other reason to use Roots, that's enough.

I haven't moved all the content yet, I'm sure it'll slow down, but I'm not sure middleman-contentful was ever that fast.

Mathias Biilmann
@biilmann
Jun 16 2016 00:52
@javaporter awesome to hear!
Eleazar Junsan
@eljun
Jun 16 2016 00:53
It's one of the reasons why our team chooses root over other gen.
Tom Kraak
@tkraak
Jun 16 2016 01:06
@javaporter ... thanks for reporting back! very interesting, I'll confirm in a bit
Tom Kraak
@tkraak
Jun 16 2016 02:52
@javaporter @jescalan … issue somewhat confirmed … if I comment out template: views/layouts/_blog.jade then body(id= _path.match(/(\w+)\.html$/)[1]) works fine, but now h4: a(href= post._url.replace(/.html$/,""))= post.titlebreaks
so the issue just flipped around for me :)
Tom Kraak
@tkraak
Jun 16 2016 03:04
well, I take that back … I assume h4: a(href= post._url.replace(/.html$/,""))= post.title is expected to break since we no longer have a single page view defined … somebody correct me please
Aman Mittal
@amandeepmittal
Jun 16 2016 05:44
How to get started with roots if I have already existing website in Bootstrap and HTML and would like to use roots such that I can have a blog too?
Tom Kraak
@tkraak
Jun 16 2016 10:55
@amandeepmittal you'll have to do this "by hand" ... look at the docs, get started and ask more questions
Marc Haan
@Hoenoe
Jun 16 2016 13:03
Hey @tkraak thanks for the help last time. I have another do you also know how to install a auto prefixer that works with node-sass
*question
Tom Kraak
@tkraak
Jun 16 2016 13:14
@Hoenoe we touched on this in this room before … let me dig it up … gitter search sucks though unless I don’t know how to use it :)
Tom Kraak
@tkraak
Jun 16 2016 14:46
@Hoenoe … since there is no autoprefixer plugin for sass (as far as I can tell), I’m thinking in my newbie ways that we need to get postcss into the mix somehow
no idea exactly how yet, need to experiment
Perry Kibler
@javaporter
Jun 16 2016 15:37
@tkraak it would be great if this was built into the framework, it's one spot where MM makes life a lot easier (body class='#{page_classes}'). I've spent too much time on this now. As a work around:
var sitePath = window.location.pathname;
  var newClass = sitePath.match(/[^\/]*[^\d\/][^\/]*/);
  if (newClass) {
    $('body').addClass(newClass[0]);
  }
Tom Kraak
@tkraak
Jun 16 2016 15:41
@javaporter thanks for that!
Jeff Escalante
@jescalan
Jun 16 2016 15:44
@tkraak @javaporter thanks guys for digging deeper on this one
if you narrow it down to something specific, feel free to file an issue and i can look into it when I have a minute
I have my hands pretty full atm, so I appreciate you guys taking the time to narrow down the issue
Tom Kraak
@tkraak
Jun 16 2016 15:45
@jescalan thanks for checking in on us … narrowing things down is the least we can do :)
Jeff Escalante
@jescalan
Jun 16 2016 15:45
If I have a moment, I'll put together a local that you can plug and play and it will do the page classes thing
Marc Haan
@Hoenoe
Jun 16 2016 15:45
@tkraak ah oke Ill just stick to doing it manually for now. Thanks for digging in on it
Jeff Escalante
@jescalan
Jun 16 2016 15:46
Right now heavy work going into spike, but if i make one it will work with both
Tom Kraak
@tkraak
Jun 16 2016 15:46
@jescalan … so it looks like the contentful-extension is the issue … no?
Jeff Escalante
@jescalan
Jun 16 2016 15:46
I use this feature a lot, so I'll make sure it works
Tom Kraak
@tkraak
Jun 16 2016 15:46
it throws something off
Jeff Escalante
@jescalan
Jun 16 2016 15:46
yeah it seems like it might be
i dont maintain that extension at all though
that's @declandewet and @kylemac as far as i know
Tom Kraak
@tkraak
Jun 16 2016 15:47
should we file an issue on the extension repo then?
Tom Kraak
@tkraak
Jun 16 2016 15:55
@jescalan … we won’t be able to use mpg effectively until you fix this :smile:
Jeff Escalante
@jescalan
Jun 16 2016 16:14
this is true
yeah if you have narrowed it down enough file an issuye
Edin Abazi
@edinchez
Jun 16 2016 22:38

@jescalan i tried including this

locals: { sort: function (arr) { sort(arr) } }

in my app.coffee, but im getting an error
Nathan Donaldson
@nathandonaldson
Jun 16 2016 23:00
Hi all - I have what I assume is a very simple problem but can't find the answer anywhere :-)
I have a field from Contentful that outputs fine in my Jade template e.g = entry.projectDescription
But I can't work out how to get :marked to accept it for output?
h1 Hello World
  ul
    - for post in contentful.posts
      li
        h2= post.title
        p= markdown(post.body)
apparently there's a markdown() function
never used contentful or anything, just found this, should work though
Nathan Donaldson
@nathandonaldson
Jun 16 2016 23:05
Thanks @edinchez It's reporting that there isn't a markdown function
markdown is not a function
Edin Abazi
@edinchez
Jun 16 2016 23:06
sorry, that's as much as i can help, you should wait for someone else to reply
Nathan Donaldson
@nathandonaldson
Jun 16 2016 23:07
Thanks :-) Will do
Jeff Escalante
@jescalan
Jun 16 2016 23:42
@nathandonaldson you can import one yourself
just npm i marked -S
then require it in your app.coffee
then pass it in as a local
@edinchez what is the error?