From 85f053f445ba0aa5fc0d0e2be5b990b5cd56ba3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Wed, 7 Jan 2026 20:46:17 +0100 Subject: [PATCH] Index: do not index drafts --- src/Util/IndexableArticleChecker.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Util/IndexableArticleChecker.php b/src/Util/IndexableArticleChecker.php index 098fa52..ffb1352 100644 --- a/src/Util/IndexableArticleChecker.php +++ b/src/Util/IndexableArticleChecker.php @@ -4,11 +4,22 @@ namespace App\Util; use App\Entity\Article; use App\Enum\IndexStatusEnum; +use App\Enum\KindsEnum; class IndexableArticleChecker { public static function isIndexable(Article $article): bool { - return $article->getIndexStatus() !== IndexStatusEnum::DO_NOT_INDEX; + // Don't index drafts - they're private working copies + if ($article->getKind() === KindsEnum::LONGFORM_DRAFT->value) { + return false; + } + + // Don't index articles explicitly marked as do not index + if ($article->getIndexStatus() === IndexStatusEnum::DO_NOT_INDEX) { + return false; + } + + return true; } }