Pulling in latest articles in root of site

I have installed Kirby as a CMS plugin to an existing static site.

I put my installation in a sub folder.

I am now wondering whether I can pull in latest articles from that sub folder into the root pages of my site?

First option that comes to mind is using a route that returns the latest articles as JSON, then fetch those articles via JS in your static pages.

Edit: as an alternative to the route, you could also use acontent representation that returns the last x articles

You can also do it from an RSS feed, again by pulling it in via javascript. Something like this.

Thank you for both your answers!

I am currently trying the first option with JSON. Iā€™m trying to fetch the data but am getting the following error:

error: SyntaxError: Unexpected token < in JSON at position 1

Could you please post your code?

@jacklinwood I just stumbled on this little javascript plugin. It might help you out here.


Thanks for the help guys!