Commit e0053ad6 authored by Mark Harding's avatar Mark Harding

(feat): change robots to ask for thumb counts

parent 678abba9
No related merge requests found
Pipeline #64226099 passed with stages
in 9 minutes and 8 seconds
......@@ -5,6 +5,7 @@ namespace Minds\Core\Blogs;
use Minds\Core;
use Minds\Entities;
use Minds\Helpers;
use Minds\Helpers\Counters;
class SEO
{
......@@ -123,6 +124,10 @@ class SEO
$custom_meta = $blog->getCustomMeta();
// More than 2 votes allows indexing to search engines (prevents spam)
$allowIndexing = Counters::get($blog->getGuid(), 'thumbs:up') >= 2;
return $meta = array(
'title' => $custom_meta['title'] ?: $blog->getTitle(),
'description' => $custom_meta['description'] ?: $body,
......@@ -136,7 +141,7 @@ class SEO
'og:image:height' => 1000,
'al:ios:url' => 'minds://blog/view/' . $blog->getGuid(),
'al:android:url' => 'minds://blog/view/' . $blog->getGuid(),
'robots' => $blog->getRating() == 1 ? 'all' : 'noindex',
'robots' => $allowIndexing ? 'all' : 'noindex',
);
}
}
......@@ -8,6 +8,7 @@ namespace Minds\Core\SEO;
use Minds\Core;
use Minds\Entities;
use Minds\Helpers;
use Minds\Helpers\Counters;
class Defaults
{
......@@ -109,6 +110,10 @@ class Defaults
$activity = new Entities\Activity($activity->remind_object);
}
// More than 2 votes allows indexing to search engines (prevents spam)
$allowIndexing = Counters::get($activity->getGuid(), 'thumbs:up') >= 2;
$meta = [
'title' => $activity->title ?: $activity->message,
'description' => $activity->blurb ?: "@{$activity->ownerObj['username']} on {$this->config->site_name}",
......@@ -122,7 +127,7 @@ class Defaults
'twitter:card' => 'summary',
'al:ios:url' => 'minds://activity/' . $activity->guid,
'al:android:url' => 'minds://minds/activity/' . $activity->guid,
'robots' => $activity->getRating() == 1 ? 'all' : 'noindex',
'robots' => $allowIndexing ? 'all' : 'noindex',
];
if ($activity->custom_type == 'video') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment