From 23bafaba26fb30b1277863a1df00057bdef74ce2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 26 Jan 2012 11:02:29 -0500 Subject: [PATCH] add canonical rel --- actions/public.php | 5 +++++ actions/showgroup.php | 8 ++++++++ actions/showstream.php | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/actions/public.php b/actions/public.php index 7bcdd3fae2..8c72446636 100644 --- a/actions/public.php +++ b/actions/public.php @@ -159,6 +159,11 @@ class PublicAction extends Action $this->element('link', array('rel' => 'EditURI', 'type' => 'application/rsd+xml', 'href' => $rsd)); + + if ($this->page != 1) { + $this->element('link', array('rel' => 'canonical', + 'href' => common_local_url('public'))); + } } /** diff --git a/actions/showgroup.php b/actions/showgroup.php index eba3191f6f..10601e58b4 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -233,4 +233,12 @@ class ShowgroupAction extends GroupAction $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); } + + function extraHead() + { + if ($this->page != 1) { + $this->element('link', array('rel' => 'canonical', + 'href' => $this->group->homeUrl())); + } + } } diff --git a/actions/showstream.php b/actions/showstream.php index a3b1794313..9e89b1b48c 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -212,6 +212,11 @@ class ShowstreamAction extends ProfileAction $this->element('link', array('rel' => 'EditURI', 'type' => 'application/rsd+xml', 'href' => $rsd)); + + if ($this->page != 1) { + $this->element('link', array('rel' => 'canonical', + 'href' => $this->profile->profileurl)); + } } function showEmptyListMessage() -- 2.39.5