{"id":15643209,"url":"https://github.com/bnomei/kirby3-feed","last_synced_at":"2026-03-06T12:31:41.925Z","repository":{"id":37587598,"uuid":"147839098","full_name":"bnomei/kirby3-feed","owner":"bnomei","description":"Generate ATOM/JSON/RSS-Feed and XML-Sitemap from Pages-Collection","archived":false,"fork":false,"pushed_at":"2025-11-17T11:39:44.000Z","size":346,"stargazers_count":71,"open_issues_count":4,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-17T13:26:24.112Z","etag":null,"topics":["atom","feed","json","kirby","kirby-cms","kirby-plugin","kirby4","kirby5","rss","rss-feed","seo","seo-friendly","seo-optimization","sitemap","sitemap-xml"],"latest_commit_sha":null,"homepage":"https://forum.getkirby.com/t/kirby3-feed-rss-json-sitemap/23574","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnomei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"bnomei","patreon":"bnomei","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://buymeacoff.ee/bnomei","https://paypal.me/bnomei"]}},"created_at":"2018-09-07T15:04:49.000Z","updated_at":"2025-11-17T11:39:36.000Z","dependencies_parsed_at":"2025-08-20T06:32:53.823Z","dependency_job_id":"7226881c-8353-40e3-8333-e004dcae0366","html_url":"https://github.com/bnomei/kirby3-feed","commit_stats":{"total_commits":102,"total_committers":9,"mean_commits":"11.333333333333334","dds":0.3431372549019608,"last_synced_commit":"e6ffb5947b58459cf848a1a3f0ee3c344fa46917"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/bnomei/kirby3-feed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnomei%2Fkirby3-feed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnomei%2Fkirby3-feed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnomei%2Fkirby3-feed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnomei%2Fkirby3-feed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnomei","download_url":"https://codeload.github.com/bnomei/kirby3-feed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnomei%2Fkirby3-feed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30176172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","feed","json","kirby","kirby-cms","kirby-plugin","kirby4","kirby5","rss","rss-feed","seo","seo-friendly","seo-optimization","sitemap","sitemap-xml"],"created_at":"2024-10-03T11:59:28.168Z","updated_at":"2026-03-06T12:31:41.906Z","avatar_url":"https://github.com/bnomei.png","language":"PHP","funding_links":["https://github.com/sponsors/bnomei","https://patreon.com/bnomei","https://buymeacoff.ee/bnomei","https://paypal.me/bnomei","https://www.buymeacoffee.com/bnomei"],"categories":[],"sub_categories":[],"readme":"# Kirby Atom/JSON/RSS-Feed and XML-Sitemap\n\n[![Kirby 5](https://flat.badgen.net/badge/Kirby/5?color=ECC748)](https://getkirby.com)\n![PHP 8.2](https://flat.badgen.net/badge/PHP/8.2?color=4E5B93\u0026icon=php\u0026label)\n![Release](https://flat.badgen.net/packagist/v/bnomei/kirby3-feed?color=ae81ff\u0026icon=github\u0026label)\n![Downloads](https://flat.badgen.net/packagist/dt/bnomei/kirby3-feed?color=272822\u0026icon=github\u0026label)\n[![Coverage](https://flat.badgen.net/codeclimate/coverage/bnomei/kirby3-feed?icon=codeclimate\u0026label)](https://codeclimate.com/github/bnomei/kirby3-feed)\n[![Maintainability](https://flat.badgen.net/codeclimate/maintainability/bnomei/kirby3-feed?icon=codeclimate\u0026label)](https://codeclimate.com/github/bnomei/kirby3-feed/issues)\n[![Discord](https://flat.badgen.net/badge/discord/bnomei?color=7289da\u0026icon=discord\u0026label)](https://discordapp.com/users/bnomei)\n[![Buymecoffee](https://flat.badgen.net/badge/icon/donate?icon=buymeacoffee\u0026color=FF813F\u0026label)](https://www.buymeacoffee.com/bnomei)\n\nGenerate a Atom/JSON/RSS-Feed and XML-Sitemap from Pages-Collection.\n\n## Installation\n\n- unzip [master.zip](https://github.com/bnomei/kirby3-feed/archive/master.zip) as folder `site/plugins/kirby3-feed` or\n- `git submodule add https://github.com/bnomei/kirby3-feed.git site/plugins/kirby3-feed` or\n- `composer require bnomei/kirby3-feed`\n\n## Usage Feed\n\nYou can use this in a template for a dedicated feed page, in a template controller or a route.\n\n```php\n\u003c?php\n$options = [\n    'title' =\u003e 'Latest articles',\n    'description' =\u003e 'Read the latest news about our company',\n    'link' =\u003e 'blog'\n];\necho page('blog')-\u003echildren()-\u003elisted()-\u003eflip()-\u003elimit(10)-\u003efeed($options);\n```\n\n### options array defaults\n\nIf you use these defaults you need to provide the fields `date (type: date)` and `text (type: text)`.\n\n```php\n[\n    'datefield' =\u003e 'date',\n    'dateformat' =\u003e 'r',\n    'description' =\u003e '',\n    'feedurl' =\u003e site()-\u003eurl() . '/feed/',\n    'link' =\u003e site()-\u003eurl(),\n    'mime' =\u003e null,\n    'modified' =\u003e time(),\n    'snippet' =\u003e 'feed/rss', // 'feed/json', 'feed/atom'\n    'sort' =\u003e true,\n    'textfield' =\u003e 'text',\n    'title' =\u003e 'Feed',\n    'titlefield' =\u003e 'title',\n    'url' =\u003e site()-\u003eurl(),\n    'urlfield' =\u003e 'url',\n]\n```\n\n### virtual page in site/config/config.php\n\n```php\nreturn [\n    'routes' =\u003e [\n        [\n            'pattern' =\u003e 'feed',\n            'method' =\u003e 'GET',\n            'action'  =\u003e function () {\n                $options = [\n                    'title' =\u003e 'Latest articles',\n                    'description' =\u003e 'Read the latest news about our company',\n                    'link' =\u003e 'blog',\n                    'feedurl' =\u003e site()-\u003eurl() . '/feed/', // matches pattern above\n                ];\n                \n                // while this would be possible\n                // return page('blog')-\u003echildren()-\u003elisted()-\u003eflip()-\u003elimit(10)-\u003efeed($options);\n                \n                // using a closure allows for better performance on a cache hit\n                return feed(fn() =\u003e page('blog')-\u003echildren()-\u003elisted()-\u003eflip()-\u003elimit(10), $options);\n            }\n        ],\n    ],\n];\n```\n\n### HTML head element\n\nrss xml\n```php\n\u003clink rel=\"alternate\" type=\"application/rss+xml\" title=\"Latest articles\" href=\"\u003c?= site()-\u003eurl() ?\u003e/feed\"/\u003e\n```\nand/or rss json\n```php\n\u003clink rel=\"alternate\" type=\"application/json\" title=\"Latest articles\" href=\"\u003c?= site()-\u003eurl() ?\u003e/feed\"/\u003e\n```\n\n\u003e TIP: Having multiple feed links is still valid html. So you can have both rss and json if you want and setup the routes properly.\n\n### Sorting\n\nThe Plugin applies a default sorting for the pages by date/modified in descending order (newest first). \n\n- If you do not want this you have to set the `datefield` setting to another Field name or PageMethod name.\n- If you want to disable sorting by the plugin and add your own you can set the option `sort` to `false`.\n\n### Pitfalls when presorting by date and limit\n\nUsing `sortBy('date', 'desc')` will **not** yield expected results! In K3 sorting by date needs a callback.\n```php\n$feed = page('blog')-\u003echildren()-\u003elisted()-\u003esortBy(function ($page) {\n return $page-\u003edate()-\u003etoDate();\n}, 'desc')-\u003elimit(10)-\u003efeed($options);\n```\n\n## Usage Sitemap\n\n### options array defaults\n\nIf you use these defaults you need to provide the fields `date (type: date)` and `text (type: text)`.\n\n```php\n[\n    'dateformat' =\u003e 'c',\n    'feedurl' =\u003e site()-\u003eurl().'/sitemap.xml',\n    'imagecaptionfield' =\u003e 'caption',\n    'imagelicensefield' =\u003e 'license',\n    'images' =\u003e false,\n    'imagesfield' =\u003e 'images',\n    'imagetitlefield' =\u003e 'title',\n    'mime' =\u003e null,\n    'modified' =\u003e time(),\n    'snippet' =\u003e 'feed/sitemap',\n    'sort' =\u003e true,\n    'urlfield' =\u003e 'url',\n    'videodescriptionfield' =\u003e 'description',\n    'videos' =\u003e false,\n    'videosfield' =\u003e 'videos',\n    'videothumbnailfield' =\u003e 'thumbnail',\n    'videotitlefield' =\u003e 'title',\n    'videourlfield' =\u003e 'url',\n    'xsl' =\u003e true,\n]\n```\n\n### virtual page in site/config.php\n\n```php\nreturn [\n    'routes' =\u003e [\n        // ... other routes,\n        [\n            'pattern' =\u003e 'sitemap.xml',\n            'method' =\u003e 'GET',\n            'action'  =\u003e function () {\n                // while this would be possible\n                // return site()-\u003eindex()-\u003elisted()-\u003elimit(50000)-\u003esitemap();\n                \n                // using a closure allows for better performance on a cache hit\n                return sitemap(fn() =\u003e site()-\u003eindex()-\u003elisted()-\u003elimit(50000));\n            }\n        ],\n        // (optional) Add stylesheet for human readable version of the xml file.\n        // With that stylesheet visiting the xml in a browser will per-generate the images.\n        // The images will NOT be pre-generated if the xml file is downloaded (by google).\n        [\n            'pattern' =\u003e 'sitemap.xsl',\n            'method' =\u003e 'GET',\n            'action'  =\u003e function () {\n                snippet('feed/sitemapxsl');\n                die;\n            }\n        ],\n    ],\n];\n```\n\n### example for excluding pages from sitemap\n\nsee the official Kirby documentation: [Filtering compendium](https://getkirby.com/docs/cookbook/content/filtering)\n\n```php\nreturn sitemap(fn() =\u003e site()-\u003eindex()-\u003elisted()\n    -\u003efilterBy('template', '!=', 'excludeme')\n    -\u003elimit(50000)\n);\n```\n\n## Settings\n\n| bnomei.feed.              | Default        | Description                                          |            \n|---------------------------|----------------|------------------------------------------------------|\n| expires |`60*24*7` | expire cache in minutes, or on any change to content |\n\n\n## Cache\n\n\u003e [!Warning]\n\u003e If the **global** debug option is set to `true` the plugin will automatically flush its own cache. The plugin will automatically in-validate the cache if any of the Page objects in given Pages-Collection were modified with the Panel.\n\nIf you need to flush the cache manually, like after automated deployments or transferring files via FTP, you can use the following code:\n\n```php\n\\Bnomei\\Feed::flush();\n```\n\nOr simply delete the cache files/folder at `site/cache/{{ HOST }}/plugins/bnomei/feed`.\n\n## Disclaimer\n\nThis plugin is provided \"as is\" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please [create a new issue](https://github.com/bnomei/kirby3-feed/issues/new).\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n\nIt is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.\n\n## Credits\n\nbased on K2 versions of\n- https://github.com/getkirby-plugins/feed-plugin\n- https://github.com/stefanzweifel/kirby-json-feed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnomei%2Fkirby3-feed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnomei%2Fkirby3-feed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnomei%2Fkirby3-feed/lists"}