-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.php
More file actions
36 lines (29 loc) · 1.07 KB
/
rss.php
File metadata and controls
36 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
require __DIR__ . '/src/Config.php';
require __DIR__ . '/src/Constants.php';
require __DIR__ . '/src/Utils.php';
require __DIR__ . '/src/RenderMarkdown.php';
require __DIR__ . '/src/MarkdownProcessor.php';
require __DIR__ . '/src/IndexManager.php';
require __DIR__ . '/src/PageGenerator.php';
require __DIR__ . '/src/Content.php';
require __DIR__ . '/src/Rss.php';
require __DIR__ . '/src/Language.php';
use BitBlog\Config;
use BitBlog\Content;
use BitBlog\Language;
use BitBlog\Rss;
date_default_timezone_set(Config::TIMEZONE);
// Ensure consistent locale for IntlDateFormatter (independent of server defaults)
\Locale::setDefault(Language::getLocale());
// Set RSS headers FIRST
header('Content-Type: application/rss+xml; charset=UTF-8');
$content = new Content(
Config::CONTENT_DIR,
Config::CACHE_DIR,
Config::BASE_URL()
);
$rssLimit = Config::RSS_POSTS_LIMIT > 0 ? Config::RSS_POSTS_LIMIT : PHP_INT_MAX;
echo Rss::build($content->getRecentPosts($rssLimit), Config::SITE_TITLE, Config::BASE_URL());
?>