DEV Community

Discussion on: Creating JSON Files with Eleventy

Collapse
makingthings profile image
James Grubb

Hi thanks for this, sorry Im late to this party. Would you mind expanding a little when you suggest "With this data now exported to a file in your site, you could consume it with a library like axios (or fetch if you're hardcore) in order to build out functionalities like search and sorting/filtering with a library like Svelte!"
Do you mean using it as an API for another site or using the data within the existing eleventy.js site? Thanks in advance.

Collapse
mattwaler profile image
Matt Waler Author

In my example, I was referring to using the data on the same site. So, you could hit your new data route with axios or fetch, and use that JSON to power something like a real time search/filter on your blog listing page, possibly with a library like Fuse.js!

Collapse
makingthings profile image
James Grubb

Thank you for the clarification :)