seo improvements
This commit is contained in:
@@ -1,5 +1,37 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('page_title')
|
||||
{{ $book->title }}
|
||||
by
|
||||
@if($book->authors && $book->authors->count())
|
||||
{{ $book->authors->pluck('name')->join(', ') }}
|
||||
@elseif($book->author)
|
||||
{{ $book->author }}
|
||||
@endif
|
||||
- Summary by OpenTextSummaries
|
||||
@endsection
|
||||
|
||||
@section('meta_description')
|
||||
@php
|
||||
$raw = '';
|
||||
if ($book->summary && $book->summary->content) {
|
||||
$raw = strip_tags($book->summary->content);
|
||||
} elseif (!empty($book->description)) {
|
||||
$raw = strip_tags($book->description);
|
||||
} else {
|
||||
$authorNames = '';
|
||||
if ($book->authors && $book->authors->count()) {
|
||||
$authorNames = $book->authors->pluck('name')->join(', ');
|
||||
} elseif (!empty($book->author)) {
|
||||
$authorNames = $book->author;
|
||||
}
|
||||
$raw = trim($book->title . ($authorNames ? ' by ' . $authorNames : '') . ' — summary and key insights.');
|
||||
}
|
||||
$desc = \Illuminate\Support\Str::limit(preg_replace('/\s+/', ' ', $raw), 160, '…');
|
||||
@endphp
|
||||
{{ $desc }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<article class="bg-white rounded-lg shadow overflow-hidden">
|
||||
<div class="md:flex">
|
||||
@@ -81,6 +113,10 @@
|
||||
@endauth
|
||||
@endif
|
||||
|
||||
<div class="mt-8 pt-6 border-t">
|
||||
@include('layouts.donate_widget')
|
||||
</div>
|
||||
|
||||
<div class="mt-8 pt-6 border-t">
|
||||
<h3 class="text-lg font-semibold mb-2">Is this summary inaccurate?</h3>
|
||||
@auth
|
||||
|
||||
Reference in New Issue
Block a user