These are chat archives for jescalan/roots

15th
Nov 2015
Nick Garland
@ngarland79
Nov 15 2015 02:54 UTC
I'm a newbie, so bear with me, and thanks for being patient. I am attempting to generate individual HTML files for each record in a JSON response using roots-records. For the life of me, I can't get it to create the files and I am getting no errors. Here's the coffeescript. "pterosaurs" works (a list of records in a single page) but "pterosaurs_single" does not work.
records
      pterosaurs:
        url: api_url
        path: "records"
      pterosaurs_single:
        url: api_url
        path: "records"
        template: "views/_pterosaur.jade"
        out: (pterosaurs_single) -> "pterosaurs/#{pterosaurs_single.fields.Name}"
Jeff Escalante
@jescalan
Nov 15 2015 14:28 UTC
Have you tried it with only pterosaurs_single?
Martin Berggren
@marthings
Nov 15 2015 16:40 UTC
Is there an article/news of the upcomming new stuff you mentioned earlier @jenius :)?
Nick Garland
@ngarland79
Nov 15 2015 19:08 UTC
@jenius unfortunately that doesn't work either
Jeff Escalante
@jescalan
Nov 15 2015 19:09 UTC
@marthings there is. you can do some more digging by searching on github for "roots-mini"
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:09 UTC
Hi @jenius
Jeff Escalante
@jescalan
Nov 15 2015 19:09 UTC
@ngarland79 that is very confusing. well, the tests are passing on roots-records for this configuration. could you share the project on github and i can take a look?
hi @thangngoc89 :)
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:10 UTC
can roots-record do something like this https://middlemanapp.com/advanced/dynamic_pages/
I'm really lost here :worried:
Jeff Escalante
@jescalan
Nov 15 2015 19:11 UTC
yeah you can do this with roots-records
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:11 UTC
yup :clap:
Jeff Escalante
@jescalan
Nov 15 2015 19:11 UTC
:+1:
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:11 UTC
That's just awesome :+1:
Jeff Escalante
@jescalan
Nov 15 2015 19:11 UTC
For sure!
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:12 UTC
After talking to the client, I can convince him to use dynamic pagination
So all problems was solved.
Go roots >_<
Nick Garland
@ngarland79
Nov 15 2015 19:13 UTC
@jenius Just added you as a collaborator on "pteros-web". Thanks so much for helping out.
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:14 UTC
I spent a whole day research about static site generators
and I only found 3 generators that have roots-record feature
Jeff Escalante
@jescalan
Nov 15 2015 19:15 UTC
@ngarland79 awesome, thank you. i'll take a look at this as soon as i have a moment
whats the third? middleman is a strong option, but is limited by being written in ruby
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:16 UTC
They are dynamic-pages in middleman https://middlemanapp.com/advanced/dynamic_pages/
This pull request in Go : spf13/hugo#140
And Roots
Jeff Escalante
@jescalan
Nov 15 2015 19:16 UTC
ah yeah hugo
also a strong option, but limited by being written in go
the thing is, the front-end community has rallied around node
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:17 UTC
Yes. As middleman was written in Ruby. It's hard for me to work with
so do Hugo
Jeff Escalante
@jescalan
Nov 15 2015 19:17 UTC
so all the build tools and shit are written with js
and also more people are familiar with js that go or ruby
thats why i wrote roots in node
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:17 UTC
people like me
Jeff Escalante
@jescalan
Nov 15 2015 19:17 UTC
honestly roots would be better if i wrote it in go. it would be fast and efficient like hugo
but that would also be short-sighted
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:18 UTC
yup. roots was written in javascript
Jeff Escalante
@jescalan
Nov 15 2015 19:18 UTC
the community is just as important as the tooling
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:18 UTC
so you cannot compare it with hugo
Jeff Escalante
@jescalan
Nov 15 2015 19:18 UTC
yup
so roots is not a massive deal yet
right now most people spend a shitload of time wiring together gulp configs, different ones for each project
huge config files
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:19 UTC
ah. I wanna ask you another options
Jeff Escalante
@jescalan
Nov 15 2015 19:19 UTC
but once we get roots to a place where it's super stable, which is in the works, i have a strong feeling people will start switching over real quick
bc dealing with huge config files is not a good time
ok you have 5 minutes because its late here and i've gotta get to bed!
shoot
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:20 UTC
it 2 am here
Jeff Escalante
@jescalan
Nov 15 2015 19:20 UTC
huh where are you
you must be in like southeast asia?
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:20 UTC
do you have any plan to support JSON stream ?
yup. vietnam
Jeff Escalante
@jescalan
Nov 15 2015 19:21 UTC
hah nice. nailed it
i'll be there in like 3 weeks or so
maybe we can grab a beer
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:21 UTC
huh ?
Where are you
Jeff Escalante
@jescalan
Nov 15 2015 19:21 UTC
india
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:21 UTC
haha :)))
Jeff Escalante
@jescalan
Nov 15 2015 19:21 UTC
what do you mean with json stream?
Jeff Escalante
@jescalan
Nov 15 2015 19:22 UTC
ehh we could if there was a use case
Jeff Escalante
@jescalan
Nov 15 2015 19:22 UTC
but the streaming would provide no benefit
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:22 UTC
Why a JSON Stream? section
Jeff Escalante
@jescalan
Nov 15 2015 19:22 UTC
we would just buffer the output then compile it as static
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:23 UTC
Ok.
I'll test it with a huge JSON file
Jeff Escalante
@jescalan
Nov 15 2015 19:23 UTC
working the stream actively into the compile process is possible, but it would be challenging
that's the kind of feature where I wouldn't write it because I have no need for it, but I'd happily work with someone who did to submit a PR to support it
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:25 UTC
Yup. I have to test how roots-record work with huge JSON file first
Jeff Escalante
@jescalan
Nov 15 2015 19:25 UTC
Once you are generating 100k pages though, imho it's time to think about alternate solutions rather than this kind of optimization
like generating the pages on the fly with js on the front end
and if you desperately need them as static for search engines or something, using prerender.io
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:25 UTC
nah. just around 10k pages
Jeff Escalante
@jescalan
Nov 15 2015 19:26 UTC
same kind of deal
right now roots isn't optimized around speeding through massive builds, honestly
but that's because neither i nor the other core contribs have encountered a build this big
but we're happy to work on making it possible
10k pages will be slow
for sure
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:27 UTC
Ok. Thanks for your infomation
Jeff Escalante
@jescalan
Nov 15 2015 19:27 UTC
But if I had to deal with that kind of thing right now, I would use a front end framework, have it hit the api to build the pages, then push to netlify and activate prerender.io
ok anyways ive gotta get to bed
but will be around feel free to ping me with any other questions!
adios
Khoa Nguyen
@thangngoc89
Nov 15 2015 19:28 UTC
thank you very much
bye then :)