Canonical URL
This commit is contained in:
parent
fd29f1ce11
commit
8b17ba7a09
7
bl-plugins/canonical/languages/en.json
Normal file
7
bl-plugins/canonical/languages/en.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "Canonical",
|
||||
"description": ""
|
||||
}
|
||||
}
|
10
bl-plugins/canonical/metadata.json
Normal file
10
bl-plugins/canonical/metadata.json
Normal file
@ -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": ""
|
||||
}
|
15
bl-plugins/canonical/plugin.php
Normal file
15
bl-plugins/canonical/plugin.php
Normal file
@ -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
Block a user