Skip to content

Commit 1079e46

Browse files
soymgomezjbrooksuk
andauthored
Improving site identity management (#127)
Co-authored-by: James Brooks <[email protected]>
1 parent 2fa1767 commit 1079e46

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

resources/views/components/about.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@if ($about !== '')
22
<div>
3-
<h2 class="text-3xl font-semibold">{{ __('About This Site') }}</h2>
3+
<h1 class="text-3xl font-semibold">{{ $title }}</h1>
44
<div class="prose-sm md:prose prose-zinc mt-1 dark:prose-invert prose-a:text-primary-500 prose-a:underline">
55
{!! $about !!}
66
</div>

resources/views/components/cachet.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

1111
<title>{{ $title ?: config('cachet.title', 'Cachet') }}</title>
1212
<meta name="title" content="{{ $title ?: config('cachet.title', 'Cachet') }}" />
13-
<meta name="description" content="Status page for {{ $site_name }}." />
13+
<meta name="description" content="{{ $description }}" />
1414

1515
<!-- Open Graph / Facebook -->
1616
<meta property="og:type" content="website" />
1717
<meta property="og:url" content="{{ url(Cachet::path()) }}" />
1818
<meta property="og:title" content="{{ $title ?: config('cachet.title', 'Cachet') }}" />
19-
<meta property="og:description" content="Status page for {{ $site_name }}." />
19+
<meta property="og:description" content="{{ $description }}" />
2020

2121
<!-- Twitter -->
2222
<meta property="twitter:card" content="summary_large_image" />
2323
<meta property="twitter:url" content="{{ url(Cachet::path()) }}" />
2424
<meta property="twitter:title" content="{{ $title ?: config('cachet.title', 'Cachet') }}" />
25-
<meta property="twitter:description" content="Status page for {{ $site_name }}." />
25+
<meta property="twitter:description" content="{{ $description }}" />
2626

2727
@vite(['resources/css/cachet.css', 'resources/js/cachet.js'], 'vendor/cachethq/cachet/build')
2828
@filamentStyles

src/View/Components/About.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct(private AppSettings $settings)
2424
public function render(): View|Closure|string
2525
{
2626
return view('cachet::components.about', [
27+
'title' => $this->settings->name ?: config('cachet.title', 'Cachet'),
2728
'about' => Str::of($this->settings->about)->trim()->markdown()->toString(),
2829
]);
2930
}

src/View/Components/Cachet.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Closure;
88
use Illuminate\Contracts\View\View;
99
use Illuminate\View\Component;
10+
use Illuminate\Support\Str;
1011

1112
class Cachet extends Component
1213
{
@@ -16,13 +17,15 @@ class Cachet extends Component
1617
public function __construct(
1718
private readonly AppSettings $appSettings,
1819
private readonly CustomizationSettings $customizationSettings,
19-
private ?string $title = null
20+
private ?string $title = null,
21+
private ?string $description = null
2022
) {
2123
if ($this->title) {
2224
$this->title .= ' - '.($this->appSettings->name ?: config('cachet.title'));
2325
}
2426

2527
$this->title ??= ($this->appSettings->name ?? config('cachet.title'));
28+
$this->description ??= (Str::of($this->appSettings->about)->trim()->toString());
2629
}
2730

2831
/**
@@ -32,6 +35,7 @@ public function render(): View|Closure|string
3235
{
3336
return view('cachet::components.cachet', [
3437
'title' => $this->title,
38+
'description' => $this->description,
3539
'site_name' => $this->appSettings->name,
3640
'cachet_header' => $this->customizationSettings->header,
3741
'cachet_css' => $this->customizationSettings->stylesheet,

0 commit comments

Comments
 (0)