This commit is contained in:
Ty Clifford
2026-07-03 07:31:09 -04:00
commit cebb0d3af1
800 changed files with 89782 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"plugin-data": {
"description": "Brug af canonical URLs kan hjælpe med at informere søgemaskiner om hvilke URLs der har identisk indhold.",
"name": "Canonical"
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "Kennzeichnung von Seiten mit kanonischen Links, um Dublicate Content bei der Erfassung durch Suchmaschinen zu verhindern."
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "Kennzeichnung von Seiten mit kanonischen Links, um Dublicate Content bei der Erfassung durch Suchmaschinen zu verhindern."
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "Using canonical URLs can help to inform search engines which URLs have identical content."
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "El uso de URL canónicas ayuda a los motores de búsqueda qué URLs tienen contenido idéntico."
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "لینک استاندارد",
"description": "با استفاده از آدرس‌های وب استاندارد می‌توانید به اطلاع موتورهای جستجو برسانید که کدامیک از آدرس وب ها داری محتوای یکسانی هستند."
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "URL Canonique",
"description": "L'utilisation d'URL canoniques permet d'indiquer aux moteurs de recherche quelles URL ont un contenu identique."
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "L'utilizzo degli URLS canonici può aiutare i motori di ricerca quali URL hanno un contenuto identico."
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "カノニカル(正規化)URLを使用すると、検索エンジンに、どのURLのコンテンツが同一コンテンツであるかを通知できます。"
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonieke URLs",
"description": "Het gebruik van canonieke URLs kan helpen bij het informeren van zoekmachines over welke URLs dezelfde inhoud hebben."
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Canonical",
"description": "Плагин для использоания канонических URL-адресов. Использование канонических URL-адресов может помочь сообщить поисковым системам, какие URL-адреса имеют идентичный контент."
}
}
@@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Канонические URL-адреса",
"description": "Использование канонических URL-адресов может помочь поисковым системам грамотно идентифицировать URL-адреса страниц с дублирующимся содержанием."
}
}
+10
View File
@@ -0,0 +1,10 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.22.0",
"releaseDate": "2026-05-10",
"license": "MIT",
"compatible": "3.22",
"notes": ""
}
+87
View File
@@ -0,0 +1,87 @@
<?php
class pluginCanonical extends Plugin {
public function siteHead()
{
global $url;
global $page;
global $WHERE_AM_I;
$html = '';
$canonical = '';
switch ($WHERE_AM_I) {
case 'home':
// Handle pagination on homepage
$pageNumber = $url->pageNumber();
if ($pageNumber > 1) {
$canonical = DOMAIN_BASE . 'page/' . $pageNumber . '/';
} else {
$canonical = DOMAIN_BASE;
}
break;
case 'page':
$canonical = $page->permalink($absolute = true);
break;
case 'category':
// Category pages
$categoryKey = $url->slug();
$canonical = DOMAIN_CATEGORIES . $categoryKey . '/';
$pageNumber = $url->pageNumber();
if ($pageNumber > 1) {
$canonical .= 'page/' . $pageNumber . '/';
}
break;
case 'tag':
// Tag pages
$tagKey = $url->slug();
$canonical = DOMAIN_TAGS . $tagKey . '/';
$pageNumber = $url->pageNumber();
if ($pageNumber > 1) {
$canonical .= 'page/' . $pageNumber . '/';
}
break;
default:
// For any other page type, use current URI
$canonical = DOMAIN_BASE . ltrim($url->uri(), '/');
break;
}
if (!empty($canonical)) {
$html .= '<link rel="canonical" href="' . htmlspecialchars($canonical, ENT_QUOTES, 'UTF-8') . '">' . PHP_EOL;
// Add prev/next for paginated content (helps search engines)
$pageNumber = $url->pageNumber();
if ($pageNumber > 1) {
// Previous page
if ($pageNumber === 2) {
$prevUrl = preg_replace('/page\/\d+\/?$/', '', $canonical);
} else {
$prevUrl = preg_replace('/page\/\d+\/?$/', 'page/' . ($pageNumber - 1) . '/', $canonical);
}
$html .= '<link rel="prev" href="' . htmlspecialchars($prevUrl, ENT_QUOTES, 'UTF-8') . '">' . PHP_EOL;
}
// Next page (only if more content exists)
// This requires checking if there's a next page of content
global $content;
global $site;
if (isset($content) && is_array($content) && count($content) >= $site->itemsPerPage()) {
$nextUrl = preg_replace('/page\/\d+\/?$/', '', $canonical);
if ($pageNumber < 1) {
$nextUrl .= 'page/2/';
} else {
$nextUrl = preg_replace('/page\/\d+\/?$/', 'page/' . ($pageNumber + 1) . '/', $canonical);
}
$html .= '<link rel="next" href="' . htmlspecialchars($nextUrl, ENT_QUOTES, 'UTF-8') . '">' . PHP_EOL;
}
}
return $html;
}
}