Canonical URL
This commit is contained in:
parent
fd29f1ce11
commit
8b17ba7a09
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "Canonical",
|
||||
"description": ""
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"author": "Bludit",
|
||||
"email": "",
|
||||
"website": "https://plugins.bludit.com",
|
||||
"version": "3.6.1",
|
||||
"releaseDate": "2019-01-16",
|
||||
"license": "MIT",
|
||||
"compatible": "3.6.1",
|
||||
"notes": ""
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
class pluginCanonical extends Plugin {
|
||||
|
||||
public function siteHead()
|
||||
{
|
||||
if ($GLOBALS['WHERE_AM_I'] === 'home') {
|
||||
return '<link rel="canonical" href="'.DOMAIN_BASE.'"/>'.PHP_EOL;
|
||||
} elseif ($GLOBALS['WHERE_AM_I'] === 'page') {
|
||||
global $page;
|
||||
return '<link rel="canonical" href="'.$page->permalink().'"/>'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue