Skip to content

Commit

Permalink
[TASK] Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed Aug 30, 2023
0 parents commit dcb8393
Show file tree
Hide file tree
Showing 7 changed files with 449 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Classes/CommentRemoval.php
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']);
}
}
345 changes: 345 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions README.md
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.
1 change: 1 addition & 0 deletions Resources/Public/Icons/Extension.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions composer.json
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"
}
}
}
27 changes: 27 additions & 0 deletions ext_emconf.php
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'
]
],
];
7 changes: 7 additions & 0 deletions ext_localconf.php
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';
})();

0 comments on commit dcb8393

Please sign in to comment.