Skip to content

Commit 51c7c1f

Browse files
committed
Add SEO meta tags
1 parent cb9a873 commit 51c7c1f

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

resources/views/components/cachet.blade.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use('Cachet\Cachet')
12
<!DOCTYPE html>
23
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="bg-background-light text-base-light dark:bg-background-dark dark:text-base-dark">
34
<head>
@@ -8,6 +9,20 @@
89
<link rel="apple-touch-icon" href="{{ asset('vendor/cachethq/cachet/apple-touch-icon.png') }}" />
910

1011
<title>{{ $title ?: config('cachet.title', 'Cachet') }}</title>
12+
<meta name="title" content="{{ $title ?: config('cachet.title', 'Cachet') }}" />
13+
<meta name="description" content="Status page for {{ $site_name }}." />
14+
15+
<!-- Open Graph / Facebook -->
16+
<meta property="og:type" content="website" />
17+
<meta property="og:url" content="{{ url(Cachet::path()) }}" />
18+
<meta property="og:title" content="{{ $title ?: config('cachet.title', 'Cachet') }}" />
19+
<meta property="og:description" content="Status page for {{ $site_name }}." />
20+
21+
<!-- Twitter -->
22+
<meta property="twitter:card" content="summary_large_image" />
23+
<meta property="twitter:url" content="{{ url(Cachet::path()) }}" />
24+
<meta property="twitter:title" content="{{ $title ?: config('cachet.title', 'Cachet') }}" />
25+
<meta property="twitter:description" content="Status page for {{ $site_name }}." />
1126

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

src/View/Components/Cachet.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ class Cachet extends Component
1414
* Create a new component instance.
1515
*/
1616
public function __construct(
17-
private AppSettings $appSettings,
18-
private CustomizationSettings $customizationSettings,
17+
private readonly AppSettings $appSettings,
18+
private readonly CustomizationSettings $customizationSettings,
1919
private ?string $title = null
2020
) {
2121
if ($this->title) {
22-
$this->title .= ' - ' . ($this->appSettings->name ?: config('cachet.title'));
22+
$this->title .= ' - '.($this->appSettings->name ?: config('cachet.title'));
2323
}
2424

2525
$this->title ??= ($this->appSettings->name ?? config('cachet.title'));
@@ -32,6 +32,7 @@ public function render(): View|Closure|string
3232
{
3333
return view('cachet::components.cachet', [
3434
'title' => $this->title,
35+
'site_name' => $this->appSettings->name,
3536
'cachet_header' => $this->customizationSettings->header,
3637
'cachet_css' => $this->customizationSettings->stylesheet,
3738
'cachet_footer' => $this->customizationSettings->footer,

0 commit comments

Comments
 (0)