-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dcb8393
Showing
7 changed files
with
449 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace StudioMitte\RemoveYoastComment; | ||
|
||
use Psr\Http\Message\ServerRequestInterface; | ||
use TYPO3\CMS\Core\Http\ApplicationType; | ||
|
||
class CommentRemoval | ||
{ | ||
|
||
public function render(array &$params, $pObj): void | ||
{ | ||
if (!($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface | ||
|| !ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend() | ||
) { | ||
return; | ||
} | ||
|
||
if (!isset($params['headerData']['StructuredDataManager'])) { | ||
return; | ||
} | ||
|
||
$params['headerData']['StructuredDataManager'] = str_replace('<!-- This site is optimized with the Yoast SEO for TYPO3 plugin - https://yoast.com/typo3-extensions-seo/ -->' . PHP_EOL, '', $params['headerData']['StructuredDataManager']); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# TYPO3 Extension `remove_yoast_comment` | ||
|
||
This extension removes the comment that Yoast SEO adds to the `<head>` section of your TYPO3 site. | ||
|
||
Even though Open-Source is great, there is no need to add this hardcoded comment to every page. | ||
|
||
### Installation | ||
|
||
```console | ||
composer require studiomitte/remove-yoast-comment | ||
``` | ||
|
||
|
||
## Credits | ||
|
||
This extension was created by [Studio Mitte](https://studiomitte.com) with ♥. | ||
|
||
[Find more TYPO3 extensions we have developed](https://www.studiomitte.com/loesungen/typo3) that provide additional features for TYPO3 sites. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "studiomitte/remove-yoast-comment", | ||
"type": "typo3-cms-extension", | ||
"description": "Remove the hardcoded header comment of EXT:yoast_seo added to the frontend", | ||
"authors": [ | ||
{ | ||
"name": "Georg Ringer", | ||
"role": "Developer" | ||
} | ||
], | ||
"license": "GPL-2.0-or-later", | ||
"require": { | ||
"yoast-seo-for-typo3/yoast_seo": "^7 || ^8 || ^9" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"StudioMitte\\RemoveYoastComment\\": "Classes" | ||
} | ||
}, | ||
"extra": { | ||
"typo3/cms": { | ||
"extension-key": "remove_yoast_comment" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
$EM_CONF[$_EXTKEY] = [ | ||
'title' => 'Remove header comment of EXT:yoast_seo', | ||
'description' => 'Remove the hardcoded header comment of EXT:yoast_seo added to the frontend', | ||
'category' => 'fe', | ||
'author' => 'The Team of StudioMitte', | ||
'author_email' => '[email protected]', | ||
'author_company' => 'StudioMitte', | ||
'state' => 'stable', | ||
'version' => '1.0.0', | ||
'constraints' => [ | ||
'depends' => [ | ||
'typo3' => '10.4.0-12.4.99', | ||
'yoast_seo' => '8.0.0-9.9.99' | ||
], | ||
'conflicts' => [ | ||
], | ||
'suggests' => [ | ||
], | ||
], | ||
'autoload' => [ | ||
'psr-4' => [ | ||
'StudioMitte\\RemoveYoastComment\\\\' => 'Classes' | ||
] | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
(static function () { | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'][] | ||
=\StudioMitte\RemoveYoastComment\CommentRemoval::class . '->render'; | ||
})(); |