diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2024-01-31 06:11:00 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2024-01-31 20:45:40 +0300 |
commit | c0dc531ebefd8912819f3b6c8bda1fed3c7e750c (patch) | |
tree | 2c75aa9df182260aef09faf4befd81a4c2b9c5e2 /handler/RSS.php | |
parent | 48d688cdf7f9eae1bf11b8a6f0e5b98687c604cb (diff) |
make it simple, but not simpler
Diffstat (limited to 'handler/RSS.php')
-rw-r--r-- | handler/RSS.php | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/handler/RSS.php b/handler/RSS.php deleted file mode 100644 index 08a2136..0000000 --- a/handler/RSS.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace handler; -use posts; -use Response; -use SkinContext; - -class RSS extends \RequestHandler { - - public function get(): Response { - global $config; - - $items = array_map(fn(\Post $post) => [ - 'title' => $post->title, - 'link' => $post->getUrl(), - 'pub_date' => date(DATE_RSS, $post->ts), - 'description' => $post->getDescriptionPreview(500), - ], posts::getPosts(0, 20)); - - $ctx = new SkinContext('\\skin\\rss'); - $body = $ctx->atom( - title: ($this->lang)('site_title'), - link: 'https://'.$config['domain'], - rss_link: 'https://'.$config['domain'].'/feed.rss', - items: $items); - - $response = new Response(200, $body); - $response->addHeader('Content-Type: application/rss+xml; charset=utf-8'); - return $response; - } - -}
\ No newline at end of file |