Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/core-api",
"version": "1.6.51",
"version": "1.6.52",
"description": "Core Framework and Resources for Fleetbase API",
"keywords": [
"fleetbase",
Expand Down
4 changes: 2 additions & 2 deletions src/Support/FleetbaseBlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function normalizeLink(?string $link, ?string $blogUrl = null): st
$host = parse_url($link, PHP_URL_HOST);
$path = trim((string) parse_url($link, PHP_URL_PATH), '/');

if ($host && Str::contains($host, 'ghost.io') && $path) {
if ($host && (Str::contains($host, 'ghost.io') || $host === 'blog.fleetbase.io') && $path) {
return $blogUrl . '/' . $path;
}

Expand All @@ -74,7 +74,7 @@ public static function normalizeLink(?string $link, ?string $blogUrl = null): st
*/
public static function getFeedUrl(?string $feedUrl = null): string
{
return rtrim($feedUrl ?: getenv('FLEETBASE_BLOG_FEED_URL') ?: 'https://fleetbase.ghost.io/rss/', '/') . '/';
return rtrim($feedUrl ?: getenv('FLEETBASE_BLOG_FEED_URL') ?: 'https://blog.fleetbase.io/rss/', '/') . '/';
}

/**
Expand Down
7 changes: 4 additions & 3 deletions tests/Unit/FleetbaseBlogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function fleetbaseBlogRssFixture(): string
<item>
<title><![CDATA[First Ghost Post]]></title>
<description><![CDATA[<p>First excerpt.</p>]]></description>
<link>https://fleetbase.ghost.io/first-ghost-post/</link>
<link>https://blog.fleetbase.io/first-ghost-post/</link>
<guid isPermaLink="false">ghost-post-1</guid>
<dc:creator><![CDATA[Fleetbase Team]]></dc:creator>
<pubDate>Wed, 06 May 2026 14:31:46 GMT</pubDate>
Expand All @@ -21,7 +21,7 @@ function fleetbaseBlogRssFixture(): string
<item>
<title><![CDATA[Second Ghost Post]]></title>
<description><![CDATA[<p>Second excerpt.</p>]]></description>
<link>https://fleetbase.ghost.io/second-ghost-post/</link>
<link>https://blog.fleetbase.io/second-ghost-post/</link>
<guid isPermaLink="false">ghost-post-2</guid>
<dc:creator><![CDATA[Fleetbase Team]]></dc:creator>
<pubDate>Wed, 06 May 2026 14:30:46 GMT</pubDate>
Expand Down Expand Up @@ -63,5 +63,6 @@ function fleetbaseBlogRssFixture(): string

test('fleetbase blog link normalization keeps non ghost links unchanged', function () {
expect(FleetbaseBlog::normalizeLink('https://www.fleetbase.io/blog/already-canonical'))->toBe('https://www.fleetbase.io/blog/already-canonical')
->and(FleetbaseBlog::normalizeLink('https://fleetbase.ghost.io/ghost-post/'))->toBe('https://www.fleetbase.io/blog/ghost-post');
->and(FleetbaseBlog::normalizeLink('https://fleetbase.ghost.io/legacy-ghost-post/'))->toBe('https://www.fleetbase.io/blog/legacy-ghost-post')
->and(FleetbaseBlog::normalizeLink('https://blog.fleetbase.io/ghost-post/'))->toBe('https://www.fleetbase.io/blog/ghost-post');
});
Loading