/**
* Returns URL to a cover image for the page.
*/
- public function getCoverImage(): string
+ public function getCoverImage()
{
- $default = $this->book->getBookCover();
+ //$default = $this->book->getBookCover();
+ $default = url('/logo.png');
$firstImage = (new PageContent($this))->fetchFirstImage();
/**
* Retrieve first image in page content and return the source URL.
*/
- public function fetchFirstImage(): string
+ public function fetchFirstImage()
{
$htmlContent = $this->page->html;
$dom->loadHTML($htmlContent);
$images = $dom->getElementsByTagName('img');
- return $images ? $images[0]->getAttribute('src') : null;
+ return $images->length > 0 ? $images[0]->getAttribute('src') : null;
}
}
@push('social-meta')
<meta property="og:description" content="{{ Str::limit($page->text, 100, '...') }}">
<meta property="og:image" content="{{ $page->getCoverImage() }}">
-
-
- $pageContent->getNavigation($page->html);
@endpush
@section('body')