mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Fix #491 no display of canonical URL on some pages
This commit is contained in:
parent
9fe37502b8
commit
3fbf94f630
3 changed files with 18 additions and 10 deletions
|
|
@ -415,33 +415,34 @@ class HTMLDisplayHandler
|
|||
if ($page_type === 'article' && config('seo.og_extract_description'))
|
||||
{
|
||||
$description = trim(utf8_normalize_spaces($oDocument->getContentText(200)));
|
||||
Context::addOpenGraphData('og:description', $description);
|
||||
Context::addMetaTag('description', $description);
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::addOpenGraphData('og:description', Context::getMetaTag('description'));
|
||||
$description = Context::getMetaTag('description');
|
||||
}
|
||||
Context::addOpenGraphData('og:description', $description);
|
||||
Context::addMetaTag('description', $description);
|
||||
|
||||
// Add metadata about this page.
|
||||
Context::addOpenGraphData('og:type', $page_type);
|
||||
if ($page_type === 'article')
|
||||
{
|
||||
$document_canonical_url = getFullUrl('', 'mid', $current_module_info->mid, 'document_srl', $document_srl);
|
||||
Context::addOpenGraphData('og:url', $document_canonical_url);
|
||||
$canonical_url = getFullUrl('', 'mid', $current_module_info->mid, 'document_srl', $document_srl);
|
||||
}
|
||||
elseif (($page = Context::get('page')) > 1)
|
||||
{
|
||||
Context::addOpenGraphData('og:url', getFullUrl('', 'mid', $current_module_info->mid, 'page', $page));
|
||||
$canonical_url = getFullUrl('', 'mid', $current_module_info->mid, 'page', $page);
|
||||
}
|
||||
elseif ($current_module_info->module_srl == $site_module_info->module_srl)
|
||||
{
|
||||
Context::addOpenGraphData('og:url', Rhymix\Framework\URL::getCurrentDomainURL(\RX_BASEURL));
|
||||
$canonical_url = getFullUrl('');
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::addOpenGraphData('og:url', getFullUrl('', 'mid', $current_module_info->mid));
|
||||
$canonical_url = getFullUrl('', 'mid', $current_module_info->mid);
|
||||
}
|
||||
Context::addOpenGraphData('og:url', $canonical_url);
|
||||
Context::setCanonicalURL($canonical_url);
|
||||
|
||||
// Add metadata about the locale.
|
||||
$lang_type = Context::getLangType();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue