From 00bddaada3fad1ea390c230b1b5ac838ae7575b2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 12 Jul 2024 20:19:04 +0200 Subject: [PATCH] Check that blogging is enabled --- .../Framework/Features/Blogging/DynamicBlogPostPageHelper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Blogging/DynamicBlogPostPageHelper.php b/packages/framework/src/Framework/Features/Blogging/DynamicBlogPostPageHelper.php index 3d9d99f6024..3bc5efb7333 100644 --- a/packages/framework/src/Framework/Features/Blogging/DynamicBlogPostPageHelper.php +++ b/packages/framework/src/Framework/Features/Blogging/DynamicBlogPostPageHelper.php @@ -5,6 +5,7 @@ namespace Hyde\Framework\Features\Blogging; use Hyde\Hyde; +use Hyde\Enums\Feature; use Hyde\Pages\MarkdownPost; use Hyde\Framework\Features\Blogging\Models\PostAuthor; use Hyde\Framework\Features\Blogging\DynamicPages\PostAuthorPage; @@ -20,7 +21,7 @@ public static function canGenerateAuthorPages(): bool { // Todo: Also check that this feature is enabled - return Hyde::authors()->isNotEmpty() && MarkdownPost::all()->isNotEmpty(); + return Hyde::hasFeature(Feature::MarkdownPosts) && Hyde::authors()->isNotEmpty() && MarkdownPost::all()->isNotEmpty(); } /** @return array<\Hyde\Framework\Features\Blogging\DynamicPages\PostAuthorPage> */