These are chat archives for jescalan/roots

14th
Nov 2015
Khoa Nguyen
@thangngoc89
Nov 14 2015 16:13 UTC
Hey everyone, I knew about roots for a while. Now I had a new project that can use roots
It will be a hybrid app. I watched https://www.youtube.com/watch?v=cGzkohoTUHc and found down that it's easy to follow.
But what about pagination and tags, categories. I can't find a good tutorial for that.
Jeff Escalante
@jescalan
Nov 14 2015 16:51 UTC
haha i do like a very clean commit log
not meesing around
@thangngoc89 you can get all this information from wordpress, and set up the pagination, tags, and categories using js
just transform your array of posts and sort by category
then put it on the page with jade
basically it's a mindset change from "wordpress does it all for you" to "wordpress gives you json, you transform and manipulate with js"
:+1:
@andyshora hey im sorry for the late response
im not sure whats happening there, i'll look into it now
@dbox thanks for that rebase and merge link, thats gold. will definitely start using this
Khoa Nguyen
@thangngoc89
Nov 14 2015 16:54 UTC
@jenius thank you. I'm exploring roots
Acctually, this is a express.js project
express.js site will provide json API and I'll use roots to make a static site
Jeff Escalante
@jescalan
Nov 14 2015 16:56 UTC
yup, thats a good way to do it
we have a number of sites that run like this. it makes things super easy
have you considered using netlify, btw?
they will do the hashing and such for you, and you don't need to worry about the production options
Khoa Nguyen
@thangngoc89
Nov 14 2015 16:57 UTC
I haven't tried netlify yet
will give it a try soon
but I think Travis is pretty powerful this kind of task
I usually use Travis to build my Jekyll site and then push it to Surge (or Github Pages)
@jenius do you have any example about tags and pagination ?
Jeff Escalante
@jescalan
Nov 14 2015 17:15 UTC
Tests passing for node 0.12.x for css pipeline hashing
are you using a more recent version?
netlify is a significantly stronger option than travis, promise
i don't have an example on hand but I can describe to you how to do it
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:16 UTC
:D
I just forked roots yesterday
Jeff Escalante
@jescalan
Nov 14 2015 17:16 UTC
Take an array of all posts. Set a variable N for number of posts per page. Slice the array by N and put the first chunk on the page. When the user clicks the "next page" button, have javascript load N more posts from the array on to the page
Cool, how come? Do you have some changes you want to contribute?
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:17 UTC
Nope. sorry. I just want to make sure that I have a stable version to work with :)
So it is dynamic paging ?
Jeff Escalante
@jescalan
Nov 14 2015 17:17 UTC
Haha you can use npm for this
That's what semver is for
just lock your version and it will not change
you choose when to upgrade the version :D
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:18 UTC
found this issue jenius/roots#234
everything is in here
Jeff Escalante
@jescalan
Nov 14 2015 17:19 UTC
yup, lots of good stuff here
if you are just making a blog, and you plan on the blog being gigantic, roots is not the best choice honestly
i'd use something like ghost, which is built specifically for blogs. there are some other frameworks that are only for blogs as well
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:20 UTC
no. definitely not a blog
Jeff Escalante
@jescalan
Nov 14 2015 17:20 UTC
roots is a pretty flexible tool for building all sorts of sites. but if you have a hard core blog and need a specialist blog tool, there are better options
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:20 UTC
i'm building some kind of web crawler
put everything i can crawl into database
and export them using roots
Jeff Escalante
@jescalan
Nov 14 2015 17:21 UTC
O_o
so why are you using wordpress?
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:22 UTC
I didn't mention wordpress at all
?
Jeff Escalante
@jescalan
Nov 14 2015 17:23 UTC
ah sorry i thought when you were talking about tags and categories and such you were asking about this
thats usually the context people ask in!
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:23 UTC
haha.
Jeff Escalante
@jescalan
Nov 14 2015 17:24 UTC
but yeah use js for everything
just load in the json and use js to do transforms and update the page :)
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:24 UTC
Ok.
Jeff Escalante
@jescalan
Nov 14 2015 17:24 UTC
something like backbone, marionette, ember, angular, etc will help a lot with stuff like this
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:25 UTC
"Take an array of all posts. Set a variable N for number of posts per page. Slice the array by N and put the first chunk on the page. When the user clicks the "next page" button, have javascript load N more posts from the array on to the page"
so no static pagination right ?
Jeff Escalante
@jescalan
Nov 14 2015 17:25 UTC
nope. dont have an extension built for static pagination at the moment
we havent used it, or had any real reason to
its slower, generates lot of extra pages etc
you could in theory build an extension that did this if it was needed though
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:27 UTC
there is just 1 problem. I don't know coffeescript
But since it is complied to js
Jeff Escalante
@jescalan
Nov 14 2015 17:28 UTC
you dont have to use coffeescript
just write it in js
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:28 UTC
do I need to config anything
Jeff Escalante
@jescalan
Nov 14 2015 17:28 UTC
for what, extensions?
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:28 UTC
or it just work out of the box ?
for roots
Jeff Escalante
@jescalan
Nov 14 2015 17:29 UTC
it just works. make a .js file and it works fine
Khoa Nguyen
@thangngoc89
Nov 14 2015 17:29 UTC
woa. amazing
anyway thank you for your help. gotta go
Jeff Escalante
@jescalan
Nov 14 2015 17:31 UTC
no problem. sorry for the confusion earlier!
feel free to ask stuff here anytime :D