diff --git a/README.md b/README.md index e333c2a..5f1ca0f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ A lightweight, HTML-only status feed for self-hosted personal websites. Written * HTML and CSS implementation. No Javascript. * Accessible by default -* RSS `/feed/rss` and Atom `/feed/atom` feeds +* RSS `/rss` and Atom `/atom` feeds * CSS uploads for custom theming * Custom emoji to personalize moods (unicode only) diff --git a/src/Controller/LogController/LogController.php b/src/Controller/LogController/LogController.php index 1a907f7..d69ebcc 100644 --- a/src/Controller/LogController/LogController.php +++ b/src/Controller/LogController/LogController.php @@ -104,7 +104,7 @@ class LogController extends Controller { } private function parseLogLine(string $line): ?array { - // Parse format: [2025-01-31 08:30:15] DEBUG: 192.168.1.100 [GET feed/rss] - message + // Parse format: [2025-01-31 08:30:15] DEBUG: 192.168.1.100 [GET admin/settings] - message $pattern = '/^\[([^\]]+)\] (\w+): ([^\s]+)(?:\s+\[([^\]]+)\])? - (.+)$/'; if (preg_match($pattern, $line, $matches)) { diff --git a/src/Feed/AtomGenerator.php b/src/Feed/AtomGenerator.php index 71723da..f047d31 100644 --- a/src/Feed/AtomGenerator.php +++ b/src/Feed/AtomGenerator.php @@ -18,7 +18,7 @@ class AtomGenerator extends FeedGenerator { Log::debug("Building Atom feed for " . $this->settings->siteTitle); $feedTitle = Util::escape_xml($this->settings->siteTitle . " Atom Feed"); $siteUrl = Util::escape_xml(Util::buildUrl($this->settings->baseUrl, $this->settings->basePath)); - $feedUrl = Util::escape_xml(Util::buildUrl($this->settings->baseUrl, $this->settings->basePath, 'feed/atom')); + $feedUrl = Util::escape_xml(Util::buildUrl($this->settings->baseUrl, $this->settings->basePath, 'atom')); $updated = date(DATE_ATOM, strtotime($this->ticks[0]['timestamp'] ?? 'now')); ob_start(); diff --git a/src/Feed/RssGenerator.php b/src/Feed/RssGenerator.php index 4fb7e8d..7861d0b 100644 --- a/src/Feed/RssGenerator.php +++ b/src/Feed/RssGenerator.php @@ -23,7 +23,7 @@ class RssGenerator extends FeedGenerator { <?php echo Util::escape_xml($this->settings->siteTitle . ' RSS Feed') ?> settings->baseUrl, $this->settings->basePath))?> - settings->siteDescription) ?> diff --git a/src/Framework/Router/Router.php b/src/Framework/Router/Router.php index a5d37ce..82b4845 100644 --- a/src/Framework/Router/Router.php +++ b/src/Framework/Router/Router.php @@ -15,8 +15,8 @@ class Router { ['admin/emoji', 'EmojiController'], ['admin/emoji', 'EmojiController@handlePost', ['POST']], ['admin/logs', 'LogController'], - ['feed/rss', 'FeedController@rss'], - ['feed/atom', 'FeedController@atom'], + ['rss', 'FeedController@rss'], + ['atom', 'FeedController@atom'], ['login', 'AuthController@showLogin'], ['login', 'AuthController@handleLogin', ['POST']], ['logout', 'AuthController@handleLogout', ['GET', 'POST']], diff --git a/templates/main.php b/templates/main.php index c8ef32f..bbce15b 100644 --- a/templates/main.php +++ b/templates/main.php @@ -19,11 +19,11 @@ + href="baseUrl . $settings->basePath)?>rss/"> + href="baseUrl . $settings->basePath)?>atom/"> diff --git a/templates/partials/navbar.php b/templates/partials/navbar.php index 2c9a6f2..a987930 100644 --- a/templates/partials/navbar.php +++ b/templates/partials/navbar.php @@ -7,9 +7,9 @@ feeds diff --git a/tests/Feed/AtomGeneratorTest.php b/tests/Feed/AtomGeneratorTest.php index 0adc56a..29cf677 100644 --- a/tests/Feed/AtomGeneratorTest.php +++ b/tests/Feed/AtomGeneratorTest.php @@ -35,7 +35,7 @@ class AtomGeneratorTest extends TestCase $this->assertStringContainsString('Test Site Atom Feed', $xml); $this->assertStringContainsString('', $xml); $this->assertStringContainsString('assertStringContainsString('href="https://example.com/tkr/feed/atom"', $xml); + $this->assertStringContainsString('href="https://example.com/tkr/atom"', $xml); $this->assertStringContainsString('https://example.com/tkr/', $xml); $this->assertStringContainsString('', $xml); $this->assertStringContainsString('Test Site', $xml); @@ -69,7 +69,7 @@ class AtomGeneratorTest extends TestCase $this->assertStringContainsString('Test Site Atom Feed', $xml); $this->assertStringContainsString('', $xml); $this->assertStringContainsString('assertStringContainsString('href="https://example.com/tkr/feed/atom"', $xml); + $this->assertStringContainsString('href="https://example.com/tkr/atom"', $xml); $this->assertStringContainsString('https://example.com/tkr/', $xml); $this->assertStringContainsString('', $xml); $this->assertStringContainsString('Test Site', $xml); diff --git a/tests/Feed/RssGeneratorTest.php b/tests/Feed/RssGeneratorTest.php index 55b14be..c3f6513 100644 --- a/tests/Feed/RssGeneratorTest.php +++ b/tests/Feed/RssGeneratorTest.php @@ -34,7 +34,7 @@ class RssGeneratorTest extends TestCase $this->assertStringContainsString('assertStringContainsString('Test Site RSS Feed', $xml); $this->assertStringContainsString('https://example.com/tkr/', $xml); - $this->assertStringContainsString('assertStringContainsString('assertStringContainsString('', $xml); $this->assertStringContainsString('', $xml); $this->assertStringContainsString('', $xml); @@ -66,7 +66,7 @@ class RssGeneratorTest extends TestCase $this->assertStringContainsString('assertStringContainsString('Test Site RSS Feed', $xml); $this->assertStringContainsString('https://example.com/tkr/', $xml); - $this->assertStringContainsString('assertStringContainsString('assertStringContainsString('', $xml); $this->assertStringContainsString('', $xml); $this->assertStringEndsWith('' . "\n", $xml);