Skip to content

Commit

Permalink
shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko committed Nov 6, 2023
1 parent d2b1930 commit 25afc43
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions resources/views/layout/metadata.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@

@foreach ($opengraph as $key => $value)
@if (present($value))
@php
if ($key === 'title') {
$isHtmlString = $value instanceof HtmlString;
$value .= ' · '.page_title();
if ($isHtmlString) {
$value = new HtmlString($value);
}
}
@endphp
<meta property="og:{{ $key }}" content="{{ $value }}">
@if ($key === 'title')
<meta property="og:{{ $key }}" content="{{ $value }} · {{ page_title() }}">
@else
<meta property="og:{{ $key }}" content="{{ $value }}">
@endif
@endif
@endforeach

Expand Down

0 comments on commit 25afc43

Please sign in to comment.