diff --git a/src/applications/phame/controller/blog/PhameBlogViewController.php b/src/applications/phame/controller/blog/PhameBlogViewController.php index 758fe955ad..d8b61d8352 100644 --- a/src/applications/phame/controller/blog/PhameBlogViewController.php +++ b/src/applications/phame/controller/blog/PhameBlogViewController.php @@ -117,6 +117,15 @@ final class PhameBlogViewController extends PhameLiveController { $about, )); + $page->addHeadItem(phutil_tag( + 'link', + array( + 'rel' => 'alternate', + 'type' => 'application/atom+xml', + 'href' => $blog->getFeedURI(), + 'title' => $blog->getName(), + ))); + return $page; } diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php index 717658ec03..587f5daea3 100644 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -200,6 +200,15 @@ final class PhameBlog extends PhameDAO return '/phame/blog/manage/'.$this->getID().'/'; } + /** + * Get relative URI of Phame blog feed. + * + * @return string Relative URI of Phame blog feed + */ + public function getFeedURI() { + return '/phame/blog/feed/'.$this->getID().'/'; + } + public function getProfileImageURI() { return $this->getProfileImageFile()->getBestURI(); } diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index 17ce1db8bb..a81820de3c 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -23,6 +23,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView private $crumbs; private $navigation; private $footer; + private $headItems = array(); public function setShowFooter($show_footer) { $this->showFooter = $show_footer; @@ -375,6 +376,18 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView } + /** + * Insert a HTML element into of the page to render. + * Used by PhameBlogViewController. + * + * @param PhutilSafeHTML HTML header to add + */ + public function addHeadItem($html) { + if ($html instanceof PhutilSafeHTML) { + $this->headItems[] = $html; + } + } + protected function getHead() { $monospaced = null; @@ -407,9 +420,10 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView } return hsprintf( - '%s%s%s', + '%s%s%s%s', parent::getHead(), $font_css, + phutil_implode_html('', $this->headItems), $response->renderSingleResource('javelin-magical-init', 'phabricator')); }