diff --git a/composer.json b/composer.json index d1c78ac..4548204 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/Support/FleetbaseBlog.php b/src/Support/FleetbaseBlog.php index 73dbe32..7259b98 100644 --- a/src/Support/FleetbaseBlog.php +++ b/src/Support/FleetbaseBlog.php @@ -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; } @@ -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/', '/') . '/'; } /** diff --git a/tests/Unit/FleetbaseBlogTest.php b/tests/Unit/FleetbaseBlogTest.php index 1ff3ba3..1aecf17 100644 --- a/tests/Unit/FleetbaseBlogTest.php +++ b/tests/Unit/FleetbaseBlogTest.php @@ -11,7 +11,7 @@ function fleetbaseBlogRssFixture(): string <![CDATA[First Ghost Post]]> First excerpt.

]]>
- https://fleetbase.ghost.io/first-ghost-post/ + https://blog.fleetbase.io/first-ghost-post/ ghost-post-1 Wed, 06 May 2026 14:31:46 GMT @@ -21,7 +21,7 @@ function fleetbaseBlogRssFixture(): string <![CDATA[Second Ghost Post]]> Second excerpt.

]]>
- https://fleetbase.ghost.io/second-ghost-post/ + https://blog.fleetbase.io/second-ghost-post/ ghost-post-2 Wed, 06 May 2026 14:30:46 GMT @@ -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'); });