1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Code cleanup, refactor

Updated to use Str::length for entity descriptions.
Moved function to get first image in page to PageContent class.
This commit is contained in:
James Geiger
2021-02-09 00:16:24 -06:00
parent e458411f91
commit 48587d2c38
7 changed files with 31 additions and 11 deletions

View File

@@ -12,7 +12,6 @@
<meta charset="utf-8">
<!-- Social Cards Meta -->
<meta property="og:title" content="{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }}">
<meta property="og:url" content="{{ url()->current() }}">
@stack('social-meta')

View File

@@ -7,7 +7,7 @@
@stop
@push('social-meta')
<meta property="og:description" content="{{ Str::words($book->description, 50, '...') }}">
<meta property="og:description" content="{{ Str::limit($book->description, 100, '...') }}">
<meta property="og:image" content="{{ $book->getBookCover() }}">
@endpush

View File

@@ -7,7 +7,7 @@
@stop
@push('social-meta')
<meta property="og:description" content="{{ Str::words($chapter->description, 50, '...') }}">
<meta property="og:description" content="{{ Str::limit($chapter->description, 100) }}">
<meta property="og:image" content="{{ $chapter->book->getBookCover() }}">
@endpush

View File

@@ -1,8 +1,11 @@
@extends('tri-layout')
@push('social-meta')
<meta property="og:description" content="{{ Str::words($page->html, 50, '...') }}">
<meta property="og:description" content="{{ Str::limit($page->text, 100, '...') }}">
<meta property="og:image" content="{{ $page->getCoverImage() }}">
$pageContent->getNavigation($page->html);
@endpush
@section('body')

View File

@@ -1,7 +1,7 @@
@extends('tri-layout')
@push('social-meta')
<meta property="og:description" content="{{ Str::words($shelf->description, 50, '...') }}">
<meta property="og:description" content="{{ Str::limit($shelf->description, 100) }}">
<meta property="og:image" content="{{ $shelf->getBookCover() }}">
@endpush