Generate JSON data page in Jekyll

0

I wonder if there is any way to generate a page with data in JSON (false data) in the Jekyll .

The intent is to simulate a AJAX request for this page by already preparing the code for when the platform-generated data comes from a real database.

    
asked by anonymous 15.03.2016 / 20:05

1 answer

0

After some research I discovered Jekyll's data files , at first I thought it was possible to read those data only for middle of templates liquid , but after doing some tests I noticed that the _data/ folder is also sent to the _site/ paste after the code is compiled.

So just make a request for the file created inside the folder _data/

Example:

$.get('data/example.json', function(data) {
    console.info(data);
});
    
28.03.2016 / 14:15