Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Populate collection items from JSON or a remote API #113

Closed
kawika-connell opened this issue Jun 24, 2017 · 4 comments
Closed

Comments

@kawika-connell
Copy link

So I have recently taken an interest in JamStack, and I was wondering if Jigsaw supported this, and if not, if you guys would take interest in such a feature.

Ideally, Jigsaw would need to query an API at build time, and process the data as a collection.

I am considering implementing this myself as my first open source contribution.

@damiani
Copy link
Contributor

damiani commented Jun 24, 2017

Jigsaw doesn't support anything like this at the moment, but after digging into the concept of JamStack (something that's new to me), it's definitely a very intriguing idea. It might be worthwhile putting together a proof of concept, and sharing a little more the value that you envision and some possible use cases. We'd also have to refine the automated build process end of things, which is pretty bare-bones and outdated at the moment. There's an open PR on migrating from gulp to webpack, which I'm hoping to take another look at in the coming days.

@dweipert-3138720606
Copy link

@kawikaconnell
Just asked the same thing here #117. Of course I totally overlooked your issue just until after I posted mine.

@damiani
Copy link
Contributor

damiani commented Sep 29, 2017

Similar proposal was made on #117 :

Can I populate a collection with decoded JSON objects I get from a JSON REST API?

Each object should also generate a page, because they will be the most recent blog posts.
But not always, since there's another endpoint that just carries some links and their descriptions, so no single templates needed there.

So something like

<?php

return [
    'collections' => [
        'posts' => [
            'remote' => someFunctionReturningAPageOrFileObjectThatIsTreatedLikeAnActualFileAndGeneratesThatFile(),
            'path' => 'blog/{date|Y-m-d}/{filename}',
            'author' => 'Tighten Co.',
        ],
    ],
];

@damiani damiani changed the title [Proposal] Supporting API Based Collections (aka Supporting JamStack) [Proposal] Populate collection items from JSON or a remote API Sep 29, 2017
@damiani
Copy link
Contributor

damiani commented Mar 1, 2018

This feature has been implemented on #187. Any further discussion can take place on that PR.

@damiani damiani closed this as completed Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants