Skip to content

Commit

Permalink
Add standout tag
Browse files Browse the repository at this point in the history
  • Loading branch information
anagh-p committed Mar 27, 2018
1 parent 326a118 commit a0302c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Quintype/Seo/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ protected function getCanonicalUrl(){
}
}

protected function getStandOutUrl(){
if(isset($this->story['seo']['meta-google-news-standout'])){
return ['rel:standout' => $this->config['sketches-host'] . "/". $this->story['slug']];
} else {
[];
}
}

protected function getAlternateUrl(){
if(isset($this->config['android-package']) && $this->config['android-package'] !== ''){
$split_host_and_protocol = explode("://", $this->config['sketches-host']);
Expand Down
5 changes: 4 additions & 1 deletion src/Quintype/Seo/Story.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct($config, $pageType, $story, $card = null)
public function prepareTags()
{
if (sizeof($this->story) > 0) {
return [
$allTags = [
'title' => trim($this->getTitle()) . $this->titleTextToAppend,
'description' => trim($this->getDescription()),
'keywords' => trim($this->getKeywords(["stories" => $this->story])),
Expand All @@ -37,6 +37,9 @@ public function prepareTags()
'al:android:app-name' => $this->getAndroidData('al:android:app-name'),
'al:android:url' => 'quintypefb://'.$this->config['sketches-host'].'/'.$this->story['slug'],
];
$standOutUrl = $this->getStandOutUrl();//Check if the story is marked as standout story.

return $standOutUrl ? array_merge($allTags, $standOutUrl) : $allTags;
} else {
return ['title' => $this->getPageTitle()];
}
Expand Down

0 comments on commit a0302c4

Please sign in to comment.