mirror of
https://github.com/standardebooks/web.git
synced 2025-07-09 16:20:27 -04:00
Improve Open Graph data
This commit is contained in:
parent
45078afb2a
commit
5e23dc069e
6 changed files with 457 additions and 67 deletions
|
@ -18,6 +18,7 @@ class Ebook{
|
|||
public $HeroImage2xUrl;
|
||||
public $CoverImageUrl;
|
||||
public $CoverImage2xUrl;
|
||||
public $DistCoverUrl;
|
||||
public $Title;
|
||||
public $FullTitle;
|
||||
public $Description;
|
||||
|
@ -107,6 +108,11 @@ class Ebook{
|
|||
|
||||
$this->HasDownloads = $this->EpubUrl || $this->Epub3Url || $this->KepubUrl || $this->Azw3Url;
|
||||
|
||||
$tempPath = glob($this->WwwFilesystemPath . '/dist/cover.jpg');
|
||||
if(sizeof($tempPath) > 0){
|
||||
$this->DistCoverUrl = $this->Url . '/dist/' . basename($tempPath[0]);
|
||||
}
|
||||
|
||||
// Fill in the short history of this repo.
|
||||
$historyEntries = explode("\n", shell_exec('cd ' . escapeshellarg($this->RepoFilesystemPath) . ' && git log -n5 --pretty=format:"%ct %s"'));
|
||||
|
||||
|
@ -353,7 +359,7 @@ class Ebook{
|
|||
$output->publisher = $organizationObject;
|
||||
|
||||
$output->name = $this->Title;
|
||||
$output->image = SITE_URL . $this->Url . '/dist/cover.jpg';
|
||||
$output->image = SITE_URL . $this->DistCoverUrl;
|
||||
$output->thumbnailUrl = SITE_URL . $this->Url . '/dist/cover-thumbnail.jpg';
|
||||
$output->url = SITE_URL . $this->Url;
|
||||
$output->{'@id'} = SITE_URL . $this->Url;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue