mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Reviewed #2393, Removed image guessing and added testing
For review of meta tag additions as per PR #2393. This commit removes any image guesswork and only uses images that have been set by the author for the specific content. This also adds tests to cover the expected OG tags.
This commit is contained in:
@ -8,7 +8,9 @@
|
||||
|
||||
@push('social-meta')
|
||||
<meta property="og:description" content="{{ Str::limit($book->description, 100, '...') }}">
|
||||
<meta property="og:image" content="{{ $book->getBookCover() }}">
|
||||
@if($book->cover)
|
||||
<meta property="og:image" content="{{ $book->getBookCover() }}">
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
|
@ -7,8 +7,7 @@
|
||||
@stop
|
||||
|
||||
@push('social-meta')
|
||||
<meta property="og:description" content="{{ Str::limit($chapter->description, 100) }}">
|
||||
<meta property="og:image" content="{{ $chapter->book->getBookCover() }}">
|
||||
<meta property="og:description" content="{{ Str::limit($chapter->description, 100, '...') }}">
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
@push('social-meta')
|
||||
<meta property="og:description" content="{{ Str::limit($page->text, 100, '...') }}">
|
||||
<meta property="og:image" content="{{ $page->getCoverImage() }}">
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
|
@ -1,8 +1,10 @@
|
||||
@extends('tri-layout')
|
||||
|
||||
@push('social-meta')
|
||||
<meta property="og:description" content="{{ Str::limit($shelf->description, 100) }}">
|
||||
<meta property="og:image" content="{{ $shelf->getBookCover() }}">
|
||||
<meta property="og:description" content="{{ Str::limit($shelf->description, 100, '...') }}">
|
||||
@if($shelf->cover)
|
||||
<meta property="og:image" content="{{ $shelf->getBookCover() }}">
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
|
Reference in New Issue
Block a user