diff --git a/src/applications/phame/skins/PhameBasicBlogSkin.php b/src/applications/phame/skins/PhameBasicBlogSkin.php index 420a52ae85..38f1dd9b30 100644 --- a/src/applications/phame/skins/PhameBasicBlogSkin.php +++ b/src/applications/phame/skins/PhameBasicBlogSkin.php @@ -9,6 +9,24 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin { private $pager; private $title; + private $description; + private $oGType; + + protected function setOGType($og_type) { + $this->oGType = $og_type; + return $this; + } + protected function getOGType() { + return $this->oGType; + } + + protected function setDescription($description) { + $this->description = $description; + return $this; + } + protected function getDescription() { + return $this->description; + } protected function setTitle($title) { $this->title = $title; @@ -192,7 +210,10 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin { $matches = null; $path = $request->getPath(); + // default to the blog-wide values $this->setTitle($this->getBlog()->getName()); + $this->setDescription($this->getBlog()->getDescription()); + $this->setOGType('website'); if (preg_match('@^/post/(?P.*)$@', $path, $matches)) { $post = id(new PhamePostQuery()) ->setViewer($user) @@ -201,7 +222,10 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin { ->executeOne(); if ($post) { + $description = $post->getMarkupText(PhamePost::MARKUP_FIELD_SUMMARY); $this->setTitle($post->getTitle()); + $this->setDescription($description); + $this->setOGType('article'); $view = head($this->buildPostViews(array($post))); return $this->renderPostDetail($view); } diff --git a/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php b/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php index 23f94f71d0..02034d423c 100644 --- a/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php +++ b/src/applications/phame/skins/PhameBasicTemplateBlogSkin.php @@ -80,10 +80,12 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin { private function getDefaultScope() { return array( - 'skin' => $this, - 'blog' => $this->getBlog(), - 'uri' => $this->getURI(''), - 'title' => $this->getTitle(), + 'skin' => $this, + 'blog' => $this->getBlog(), + 'uri' => $this->getURI(''), + 'title' => $this->getTitle(), + 'description' => $this->getDescription(), + 'og_type' => $this->getOGType(), ); }