tighten / jigsaw

Simple static sites with Laravel’s Blade.
https://jigsaw.tighten.com
MIT License
2.13k stars 181 forks source link

Remote Collection API #282

Closed espositodaniele closed 6 years ago

espositodaniele commented 6 years ago

Hi there,

I'm working on a project using Jigsaw to build a website and I would like to clear some concept.

The documentation:

In addition to using Markdown or Blade files for your collection items, you can return collection items directly from the collection array in config.php. This allows you to generate items programmatically—for example, you can fetch items from a remote source such as an external API or API-based content management systems like Contentful, GraphCMS, or DatoCMS.

Steps To Reproduce:

What I'm trying to do is to fetch Reviews from a Facebook page using Graph API and to do that, I need to use an Access Token that should be out from the client code because everyone able to use the dev tools could just inspect my code and take it. So decided to use the remote collection.

Now, as new to this I have some question to get clear:

It's really annoying me I should switch to use something like Laravel as a server-side framework to achieve this. Maybe there is a way to solve this, I was really enjoying using Jigsaw as my website Is static at all unless this little thing. I'm using Vue js in this site as well.

I will really appreciate your help.

cossssmin commented 6 years ago

Since Jigsaw is a static site generator that you run locally on your machine, yeah, you’d use events at build time.

However, take a look at Netlify. You could programmatically trigger a build&deploy by pushing to your repo.

Check their JAMstack comments page: https://jamstack-comments.netlify.com/about/

espositodaniele commented 6 years ago

Hello @hellocosmin,

Yes, that's one big point. I'm using Netlify to deploy and I was able to submit a form and it's one of the reasons I don't want to switch to another framework.

You could programmatically trigger a build&deploy by pushing to your repo.

I already use build&deploy by pushing to my repo, but this means I have to push to my repo daily?

Netlify let you create a schedule to build&deploy daily, every hour etc? I'm newer to Netlify so I will check the docs.

Thanks for your answer, I'm going to check your suggestion.

espositodaniele commented 6 years ago

So I'm going to close as solved with Lambda functions on Netlify.