diff --git a/src/Quintype/Seo/Section.php b/src/Quintype/Seo/Section.php index f8c4640..9441a36 100644 --- a/src/Quintype/Seo/Section.php +++ b/src/Quintype/Seo/Section.php @@ -26,7 +26,14 @@ function prepareTags() { ] ]; } else { - return ['title' => trim($this->getPageTitle())]; + return [ + 'title' => trim($this->getPageTitle()), + 'description' => trim($this->getDescription()), + 'og' => [ + 'title' => trim($this->getPageTitle()), + 'description' => trim($this->getDescription()) + ] + ]; } } @@ -41,4 +48,16 @@ protected function getPageTitle(){ return $this->sectionName . $this->titleTextToAppend; } } + + protected function getDescription() { + if(isset($this->seoMetadata['description'])){ + if($this->seoMetadata['description']==''){ + return $this->sectionName . $this->titleTextToAppend; + }else{ + return $this->seoMetadata['description']; + } + } else { + return $this->sectionName . $this->titleTextToAppend; + } + } }