Skip to content
Permalink
Browse files

Support for rel canonical.

  • Loading branch information...
parpalak committed Apr 6, 2016
1 parent 03fe942 commit 9c6374b57e900cb15d05c79bcee6d7b2aa46c368
Showing with 4 additions and 0 deletions.
  1. +2 −0 _include/Page/Common.php
  2. +2 −0 _include/Page/HTML.php
@@ -297,6 +297,8 @@ private function parse_page_url ($request_uri)
if (S2_USE_HIERARCHY && $parent_num && $page['children_exist'] != $was_end_slash)
s2_permanent_redirect($current_path.(!$was_end_slash ? '/' : ''));
$page['canonical_path'] = $current_path.($was_end_slash ? '/' : '');
$id = $page['id'];
$bread_crumbs[] = array(
'title' => $page['title']
@@ -112,6 +112,8 @@ public function process_template ()
$meta_tags[] = '<meta name="keywords" content="'.s2_htmlencode($page['meta_keywords']).'" />';
if (!empty($page['meta_description']))
$meta_tags[] = '<meta name="description" content="'.s2_htmlencode($page['meta_description']).'" />';
if (!empty($page['canonical_path']) && defined('S2_CANONICAL_URL'))
$meta_tags[] = '<link rel="canonical" href="' . S2_CANONICAL_URL . s2_htmlencode($page['canonical_path']) . '" />';
($hook = s2_hook('proc_tpl_pre_meta_merge')) ? eval($hook) : null;
$replace['<!-- s2_meta -->'] = implode("\n", $meta_tags);

0 comments on commit 9c6374b

Please sign in to comment.
You can’t perform that action at this time.