Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2682959
D25346.1734675471.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25346.1734675471.diff
View Options
diff --git a/src/applications/phame/controller/blog/PhameBlogViewController.php b/src/applications/phame/controller/blog/PhameBlogViewController.php
--- a/src/applications/phame/controller/blog/PhameBlogViewController.php
+++ b/src/applications/phame/controller/blog/PhameBlogViewController.php
@@ -117,6 +117,15 @@
$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
--- a/src/applications/phame/storage/PhameBlog.php
+++ b/src/applications/phame/storage/PhameBlog.php
@@ -200,6 +200,15 @@
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
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -23,6 +23,7 @@
private $crumbs;
private $navigation;
private $footer;
+ private $headItems = array();
public function setShowFooter($show_footer) {
$this->showFooter = $show_footer;
@@ -375,6 +376,18 @@
}
+ /**
+ * Insert a HTML element into <head> 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 @@
}
return hsprintf(
- '%s%s%s',
+ '%s%s%s%s',
parent::getHead(),
$font_css,
+ phutil_implode_html('', $this->headItems),
$response->renderSingleResource('javelin-magical-init', 'phabricator'));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 06:17 (10 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016690
Default Alt Text
D25346.1734675471.diff (2 KB)
Attached To
Mode
D25346: Add HTML header for Atom/RSS discovery on Phame blog pages
Attached
Detach File
Event Timeline
Log In to Comment