These are chat archives for jescalan/roots

13th
Jun 2016
Eleazar Junsan
@eljun
Jun 13 2016 03:43 UTC

Hi Jeff, sorry I wasn't be able to catch you up with your reply. I can see the time difference and its lagging us both.

I have a question regarding 'roots-collections' is there an easy way to extend its functionality such as streaming an 'JSON' format for all the posts being generated?

In 'roots-records' this is fairly possible, but I'm currently using the RC plugin to generate our blog.

You might have already guess where I'm going, yes I want to implemented an 'RSS FEED' for our Blog Posts.

Hopefully you can shed some lights, on where should we be heading into.

Thanks

Jun

Jeff Escalante
@jescalan
Jun 13 2016 14:11 UTC
@kbohinski you can just put it in as usual, there is no roots secret to adding a link tag to your page
you just add it
ejs would be <%= css() %>
for the body and head blocks, you need to use ejs includes instead
check out the ejs documentation, or create a new roots project with the ejs template as an option
@eljun yeah you can make a pull request to either roots-records or collections to add a RSS feature
it would not be too difficult to add, we just haven't done it ourselves yet becuase we haven't needed it
If you need any help with roots' internal architecture or writing plugins lmk
Eleazar Junsan
@eljun
Jun 13 2016 14:14 UTC
At the moment I am only able to pull data using roots-records
using its built-in json compiler, but not so lucky digging with the codes for roots-collections
@jescalan, I am making a website blog that supports rss, I just don't know how to manipulate or extend the codes inside the roots-collection module.
Currently the compiler compiles markdown to html files, it would be good if the '.md' files can be converted to json file
Jeff Escalante
@jescalan
Jun 13 2016 15:24 UTC
I didn't write roots-collections, so I can't be of too much assistance with this, I made roots-records
sorry i mean dynamic content, not records haha
roots-records does have a feature that allows you to emit json
Tom Kraak
@tkraak
Jun 13 2016 17:01 UTC
it seems that my netlify build fails because it can’t find contentful.coffee since I keep that out of my repo
what am I missing for this to work?
Mathias Biilmann
@biilmann
Jun 13 2016 17:02 UTC
@tkraak I would recommend making contentful.coffee read the contentful settings from environment variables
then you can check it into the repo
and set environment variables for your netlify site
Tom Kraak
@tkraak
Jun 13 2016 17:05 UTC
@biilmann thx, makes more sense now … is there an example / guide anywhere?
Mathias Biilmann
@biilmann
Jun 13 2016 17:06 UTC
don’t know of any specific to roots and roots contentful - but in general on the “settings” page of your netlify site you can set environment variables for the build environment
so if you set something like CONTENTFUL_API_TOKEN
then in contentful.coffee you can access it via process.env.CONTENTFUL_API_TOKEN
Tom Kraak
@tkraak
Jun 13 2016 17:12 UTC
@biilmann oh nice … so I should turn access_token, management_token and space_id into environment variables?
up to me I guess of how much I want to hide
Tom Kraak
@tkraak
Jun 13 2016 17:19 UTC
looks like hiding the access_token is enough
Mathias Biilmann
@biilmann
Jun 13 2016 18:16 UTC
in general I would hide the tokens
Tom Kraak
@tkraak
Jun 13 2016 18:22 UTC
I created CONTENTFUL_API_KEY and CONTENTFUL_MAN_KEY, but still no luck accessing those in contentful.coffee :(
Mathias Biilmann
@biilmann
Jun 13 2016 18:26 UTC
how does your contenful.coffee look?
Tom Kraak
@tkraak
Jun 13 2016 18:29 UTC
module.exports = 
access_token: ‘xxxxxxxxx’
management_token: ‘xxxxxxxxx'
space_id: ‘1ipf5oqx1rxu'