sgalinski / sg-seo
SEO Tools for TYPO3
Requires
- typo3/cms-core: ^12.4.0
- typo3/cms-seo: ^12.4.0
Replaces
- sgalinski/sg_seo: 7.0.2
- dev-master
- 7.0.2
- 7.0.1
- 7.0.0
- v6.x-dev
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.21
- 6.0.20
- 6.0.19
- 6.0.18
- 6.0.17
- 6.0.16
- 6.0.15
- 6.0.14
- 6.0.13
- 6.0.12
- 6.0.11
- 6.0.10
- 6.0.9
- 6.0.8
- 6.0.7
- 6.0.6
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.6
- 5.3.5
- 5.3.4
- 5.3.3
- 5.3.2
- 5.3.1
- 5.3.0
- 5.2.0
- 5.1.3
- 5.1.2
- 5.1.1
- 5.1.0
- v5.0.x-dev
- 5.0.13
- 5.0.12
- 5.0.11
- 5.0.10
- 5.0.9
- 5.0.8
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.0
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.x-dev
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.1
- 1.0.0
This package is not auto-updated.
Last update: 2024-11-11 19:30:34 UTC
README
License: GNU GPL, Version 2
Repository: https://gitlab.sgalinski.de/typo3/sg_seo
Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_seo
About
This extension provides a Google sitemap implementation with additional features like:
- ignoring pages with canonical links to other pages
- respecting noindex & nofollow options
- ignoring shortcuts and status pages
Scheduler
There are two scheduler tasks for this extension
- A scheduler task to generate a sitemap for each language
- A scheduler task to generate webp versions of the processed files
Sitemap generation
This scheduler task can be activated to create static sitemaps of each language, which then can be delivered instead of a dynamic process which could take a long time.
The task takes 3 arguments:
- relativePathToSitemap: Describes where to save the generated sitemap files in the file system. This defaults to the project root.
- siteRootId: The id of the site root, where the sitemap will start
- enableFilter: Switch to add hidden pages (does not affect "NOT_IN_MENU") to the sitemap
WebP generation
This scheduler task can generate webp versions of the images in processed folders. It uses the PHP builtin
function imagewebp
and thus relies on the gd-extension to be installed (default requirement of TYPO3).
The task takes 5 arguments:
- storageUid: The uid of the file storage to process. Defaults to 1 which usually is the fileadmin
- savingPercentage: Define the minimum percentage of filesize savings the process has to achieve. By default, it is set to 10
- imageQuality: Define the image quality. This is set to 80 by default.
- batchSize: The number of files to process in one go (Note: The task will not stop after the amount of files, but fetch the amount of files, then process them before fetching the next batch. If it crashes, the task can be executed again, and it will continue with the batch it last worked on.) Defaults to 500.
- processGif: Include gif images in the processing, defaults to 0, which means no
Apache .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.$2.webp -f
RewriteRule ^(fileadmin/.+)\.(png|jpe?g)$ $1.$2.webp [L]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
AddType image/webp .webp
nginx
Add a map directive in your global nginx configuration:
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
and add these rules to your server configuration:
location ~* ^/fileadmin/.+\.(png|jpg|jpeg)$ {
add_header Vary Accept;
try_files $uri$webp_suffix $uri =404;
}
location ~* ^/other-storage/.+\.(png|jpg|jpeg)$ {
add_header Vary Accept;
try_files $uri$webp_suffix $uri =404;
}
Make sure that there are no other rules that already apply to the specified image formats and prevent further execution!
Extensions - SeoAccessPageListEventListener
You can hook into the process to extend the sitemap easily.
Example: Services.yaml
services:
MyExt\Event\Listener\SeoAccessPageListEventListener:
tags:
- name: event.listener
identifier: 'accessPageListEvent'
event: SGalinski\SgSeo\Events\AccessPageListEvent
EventListener class:
class SeoAccessPageListEventListener {
public function __invoke(\SGalinski\SgSeo\Events\AccessPageListEvent $event) {
$pageList = $event->getPageList();
// ... do something with the list and write it back to the event
$pageList[] = [
'url' => 'MY FURTHER URL',
'title' => ''
];
$event->setPageList($pageList);
}
}
More Events
Additionally there are new Events with sg_seo 5.3:
OverrideSitemapRendererEvent
allows to set a different Renderer for the final output
ShouldIncludePageInSitemapEvent
given an array of $pageInfo and a $language, you can decide not to use a page in normal pageRendering
Extensions - XmlSitemapDataProviders
We also support the official XmlSitemapDataProviders API of TYPO3. You can see more here https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/XmlSitemap/Index.html .
When we generate the sitemap, we generate every sitemap type to a new index. The default xmlSitemap type is being merged
into our sitemap.xml. Please bear in mind, that we ignore any additional data providers for the pages
unique key, as
this is the default TYPO3 unique key and we don't want any duplicates. Use another unique key for your extension.
The other sitemap types are generated into their own respective sitemap indices.
Example (News extension):
plugin.tx_seo {
config {
xmlSitemap { // new entries to the default sitemap.xml
sitemaps {
news {
provider = GeorgRinger\News\Seo\NewsXmlSitemapDataProvider
config {
...
}
}
}
}
googleNewsSitemap { // a completely new googlenewssitemap.xml
sitemaps {
news {
provider = GeorgRinger\News\Seo\NewsXmlSitemapDataProvider
config {
googleNews = 1
...
template = GoogleNewsXmlSitemap.html
}
}
}
}
}
}
This example will result into the news
unique key data provider entries being added into the default sitemap (
xmlSitemap).
The googleNewsSitemap
entry will fetch the entries from this dataprovider and create a brand new sitemap index.