Skip to content

Commit

Permalink
fix: robot tag actually assumes free pass for DataObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
mleutenegger committed Mar 8, 2024
1 parent fd8bba4 commit 19530ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Extensions/SEOSiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,22 @@ public function MetaComponents(&$tags)
'content' => 'index, follow, max-snippet:-1'
],
];
} else {
} elseif (!$source->ShowInSearch && $source instanceof SiteTree) {
$tags['robots'] = [
'tag' => 'meta',
'attributes' => [
'name' => 'robots',
'content' => 'noindex'
],
];
} else {
$tags['robots'] = [
'tag' => 'meta',
'attributes' => [
'name' => 'robots',
'content' => 'index, follow, max-snippet:-1'
],
];
}

// Add a title
Expand Down

0 comments on commit 19530ec

Please sign in to comment.