@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tweak phame blog template a bit for better Facebook integration

Summary: this makes it more sensical when you hit "share" from a bookmarklet or cut and paste a link into FB, basically by having post-specific data when sharing a post.

Test Plan: looked at generated HTML on my test blog

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4266

+30 -4
+24
src/applications/phame/skins/PhameBasicBlogSkin.php
··· 9 9 10 10 private $pager; 11 11 private $title; 12 + private $description; 13 + private $oGType; 14 + 15 + protected function setOGType($og_type) { 16 + $this->oGType = $og_type; 17 + return $this; 18 + } 19 + protected function getOGType() { 20 + return $this->oGType; 21 + } 22 + 23 + protected function setDescription($description) { 24 + $this->description = $description; 25 + return $this; 26 + } 27 + protected function getDescription() { 28 + return $this->description; 29 + } 12 30 13 31 protected function setTitle($title) { 14 32 $this->title = $title; ··· 192 210 193 211 $matches = null; 194 212 $path = $request->getPath(); 213 + // default to the blog-wide values 195 214 $this->setTitle($this->getBlog()->getName()); 215 + $this->setDescription($this->getBlog()->getDescription()); 216 + $this->setOGType('website'); 196 217 if (preg_match('@^/post/(?P<name>.*)$@', $path, $matches)) { 197 218 $post = id(new PhamePostQuery()) 198 219 ->setViewer($user) ··· 201 222 ->executeOne(); 202 223 203 224 if ($post) { 225 + $description = $post->getMarkupText(PhamePost::MARKUP_FIELD_SUMMARY); 204 226 $this->setTitle($post->getTitle()); 227 + $this->setDescription($description); 228 + $this->setOGType('article'); 205 229 $view = head($this->buildPostViews(array($post))); 206 230 return $this->renderPostDetail($view); 207 231 }
+6 -4
src/applications/phame/skins/PhameBasicTemplateBlogSkin.php
··· 80 80 81 81 private function getDefaultScope() { 82 82 return array( 83 - 'skin' => $this, 84 - 'blog' => $this->getBlog(), 85 - 'uri' => $this->getURI(''), 86 - 'title' => $this->getTitle(), 83 + 'skin' => $this, 84 + 'blog' => $this->getBlog(), 85 + 'uri' => $this->getURI(''), 86 + 'title' => $this->getTitle(), 87 + 'description' => $this->getDescription(), 88 + 'og_type' => $this->getOGType(), 87 89 ); 88 90 } 89 91