Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
139
Issues
139
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
e0053ad6
Commit
e0053ad6
authored
7 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): change robots to ask for thumb counts
parent
678abba9
master
No related merge requests found
Pipeline
#64226099
passed with stages
in 9 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
SEO.php
Core/Blogs/SEO.php
+6
-1
Defaults.php
Core/SEO/Defaults.php
+6
-1
No files found.
Core/Blogs/SEO.php
View file @
e0053ad6
...
...
@@ -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'
,
);
}
}
This diff is collapsed.
Click to expand it.
Core/SEO/Defaults.php
View file @
e0053ad6
...
...
@@ -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'
=>
$a
ctivity
->
getRating
()
==
1
?
'all'
:
'noindex'
,
'robots'
=>
$a
llowIndexing
?
'all'
:
'noindex'
,
];
if
(
$activity
->
custom_type
==
'video'
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment