These are chat archives for jescalan/roots

25th
Apr 2016
Gristel Periwinkle
@gristel
Apr 25 2016 18:03
Can anybody assist me with a question about Roots Dynamic Content please?
@jenius instead of chown.., it’s “safer” to install node with homebrew
no permission issues ever :)
Jeff Escalante
@jescalan
Apr 25 2016 18:17
i wouldnt recommend installing node with homebrew
last i heard it was not up to the latest version or actively maintained
ah never mind, looks like it is now up to date
Gristel Periwinkle
@gristel
Apr 25 2016 18:18
No problems here..
Jeff Escalante
@jescalan
Apr 25 2016 18:18
if that's the method you prefer then go for it!
Gristel Periwinkle
@gristel
Apr 25 2016 18:19
Well, I prefer not to sudo unless absolutely necessary :)
Jeff Escalante
@jescalan
Apr 25 2016 18:19
if you know how unix permissions work and control your folder structure appropriately, you will never have to!
Gristel Periwinkle
@gristel
Apr 25 2016 18:21
agreed
Jeff Escalante
@jescalan
Apr 25 2016 18:25
did you have a question about dynamic content?
Gristel Periwinkle
@gristel
Apr 25 2016 18:26
well, in the docs, it says: create a folder called posts. Is that in the root directory or in the views directory?
Because, when I do (in my case) each chapter in site.chapters.all() I get:
site.chapters.all is not a function
Jeff Escalante
@jescalan
Apr 25 2016 18:32
root
Gristel Periwinkle
@gristel
Apr 25 2016 18:33
OK, so I got that right
Jeff Escalante
@jescalan
Apr 25 2016 18:33
log out JSON.stringify(site) see if you have any content
Gristel Periwinkle
@gristel
Apr 25 2016 18:37
{"chapters":[]}
Jeff Escalante
@jescalan
Apr 25 2016 18:37
cool so it's picking up the folder
and you have some jade files in there, with front matter?
Gristel Periwinkle
@gristel
Apr 25 2016 18:38
I have deeper nesting. so inside chapters, there 2 more folders, and in those there’s an index.jade file
but JSON.stringify(site.chapters) returns empty array
Jeff Escalante
@jescalan
Apr 25 2016 18:39
ah yeah this is a bug
carrot/roots-dynamic-content#7
sorry haha
i just haven't run into it for any of our projects and so haven't had the priority to fix it
you can fix by nesting a useless file in each level
Gristel Periwinkle
@gristel
Apr 25 2016 18:40
aah I see ;-)
Jeff Escalante
@jescalan
Apr 25 2016 18:40
or take a stab at actually fixing it, which i would be eternally grateful for
Gristel Periwinkle
@gristel
Apr 25 2016 18:40
I’ll see what I can do
Jeff Escalante
@jescalan
Apr 25 2016 18:43
:tada:
Gristel Periwinkle
@gristel
Apr 25 2016 18:43
:)
Gristel Periwinkle
@gristel
Apr 25 2016 20:55
@jenius Are you still here?
Jeff Escalante
@jescalan
Apr 25 2016 21:02
yup
@gristel whats up
Gristel Periwinkle
@gristel
Apr 25 2016 21:05
Sorry, had a phonecall..
Jeff Escalante
@jescalan
Apr 25 2016 21:05
UNACCEPTABLE
Gristel Periwinkle
@gristel
Apr 25 2016 21:05
lol
I was wondering if there’s a way to order chapters in dynamic content?
Now I have this:
chapters/
├── 01-variables
│   └── index.jade
└── 02-conditionals
    └── index.jade
but when doing
    ul
      each chapter in chapters.sort()
        li= chapter
I want to display Variables instead of 01-variables
Jeff Escalante
@jescalan
Apr 25 2016 21:08
li= chapter.substring(3)
Gristel Periwinkle
@gristel
Apr 25 2016 21:09
OMG...
<— idiot
Jeff Escalante
@jescalan
Apr 25 2016 21:09
you can also name the folder Variables
Gristel Periwinkle
@gristel
Apr 25 2016 21:09
yes, but then Conditionals will come before Variables
Jeff Escalante
@jescalan
Apr 25 2016 21:09
ah yeah ok
you can make an array of the order and sort it by that
substring will work fine tho
Gristel Periwinkle
@gristel
Apr 25 2016 21:10
I’ll go with substring.. easiest fix imo
Jeff Escalante
@jescalan
Apr 25 2016 21:10
:+1:
Gristel Periwinkle
@gristel
Apr 25 2016 21:10
thanks!!
Gristel Periwinkle
@gristel
Apr 25 2016 21:38
oh, and just FYI, the link to the mojotech source in the Built with Roots article doesn’t work
Jeff Escalante
@jescalan
Apr 25 2016 22:03
@samccone :point_up: