Kirby Plugin to serve a JSON Feed. This plugin implements some of the structure fields of the JSON Feed Spec Version 1.
Put the json-feed.php
File in the /site/plugins/json-feed
folder.
git submodule add https://github.com/stefanzweifel/kirby-json-feed.git site/plugins/json-feed
- Create a new page. For example "feed" (Create folder
feed
incontent
folder. Create an empty filefeed.txt
in it) - Create a new template
feed.php
in/site/template/
- Use the following snippet to build your feed:
<?php
echo page('posts')->children()->visible()->flip()->limit(10)->jsonfeed(array(
'title' => 'My Blog JSON Feed',
'feed' => url('feed')
));
?>
Currently the following options can be passed to the jsonfeed
method:
title
: The title which should be display in the feedfeed
: The URL where the JSON Feed will be available (e.g http://domain.com/feed)datefield
: The Field which should be used for thedate_modified
key (Defaults todate
)textfield
: The Field which should be used for thecontent_html
key (Defaults totext
)
- Visit
/feed
on your site and you should see your new JSON RSS Feed.
A short ongoing list of RSS Readers which already support the JSON Format.
Feel free to open an Issue or Pull request if you know more readers which support this new standard (Or if there's another list of supported readers).
MIT