mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-19 18:28:39 +01:00
one more phame tweak for better social sharing -- make sure $uri is the full uri
Summary: basically when we're on a page we have a URIPath so set that and pass it over. I wasn't super duper happy with this but it seems to be the best way to pass this data. Test Plan: verified the og:url was correct on my dev instance of phacility blog for both the main blog and individual post view Reviewers: epriestley Reviewed By: epriestley CC: chad, aran, Korvin Differential Revision: https://secure.phabricator.com/D4269
This commit is contained in:
parent
2cc7f82ece
commit
2b0526e9f9
3 changed files with 14 additions and 2 deletions
2
externals/skins/oblivious/header.php
vendored
2
externals/skins/oblivious/header.php
vendored
|
@ -9,7 +9,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="oblivious-info">
|
<div class="oblivious-info">
|
||||||
<h1>
|
<h1>
|
||||||
<a href="<?php echo _e($uri); ?>"><?php
|
<a href="<?php echo _e($home_uri); ?>"><?php
|
||||||
echo _e($blog->getName());
|
echo _e($blog->getName());
|
||||||
?></a>
|
?></a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
@ -11,6 +11,15 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
private $title;
|
private $title;
|
||||||
private $description;
|
private $description;
|
||||||
private $oGType;
|
private $oGType;
|
||||||
|
private $uriPath;
|
||||||
|
|
||||||
|
public function setURIPath($uri_path) {
|
||||||
|
$this->uriPath = $uri_path;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
public function getURIPath() {
|
||||||
|
return $this->uriPath;
|
||||||
|
}
|
||||||
|
|
||||||
protected function setOGType($og_type) {
|
protected function setOGType($og_type) {
|
||||||
$this->oGType = $og_type;
|
$this->oGType = $og_type;
|
||||||
|
@ -214,6 +223,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->setTitle($this->getBlog()->getName());
|
$this->setTitle($this->getBlog()->getName());
|
||||||
$this->setDescription($this->getBlog()->getDescription());
|
$this->setDescription($this->getBlog()->getDescription());
|
||||||
$this->setOGType('website');
|
$this->setOGType('website');
|
||||||
|
$this->setURIPath('');
|
||||||
if (preg_match('@^/post/(?P<name>.*)$@', $path, $matches)) {
|
if (preg_match('@^/post/(?P<name>.*)$@', $path, $matches)) {
|
||||||
$post = id(new PhamePostQuery())
|
$post = id(new PhamePostQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
|
@ -226,6 +236,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->setTitle($post->getTitle());
|
$this->setTitle($post->getTitle());
|
||||||
$this->setDescription($description);
|
$this->setDescription($description);
|
||||||
$this->setOGType('article');
|
$this->setOGType('article');
|
||||||
|
$this->setURIPath('post/'.$post->getPhameTitle());
|
||||||
$view = head($this->buildPostViews(array($post)));
|
$view = head($this->buildPostViews(array($post)));
|
||||||
return $this->renderPostDetail($view);
|
return $this->renderPostDetail($view);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,8 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin {
|
||||||
return array(
|
return array(
|
||||||
'skin' => $this,
|
'skin' => $this,
|
||||||
'blog' => $this->getBlog(),
|
'blog' => $this->getBlog(),
|
||||||
'uri' => $this->getURI(''),
|
'uri' => $this->getURI($this->getURIPath()),
|
||||||
|
'home_uri' => $this->getURI(''),
|
||||||
'title' => $this->getTitle(),
|
'title' => $this->getTitle(),
|
||||||
'description' => $this->getDescription(),
|
'description' => $this->getDescription(),
|
||||||
'og_type' => $this->getOGType(),
|
'og_type' => $this->getOGType(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue