Skip to content

Commit 813a032

Browse files
committed
wip
1 parent a268d39 commit 813a032

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

src/Web/Blog/show.view.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
?>
88

9-
<x-base :meta-image-uri="uri([MetaImageController::class, 'blog'], slug: $post->slug)" :title="$post->title" :copy-code-blocks="true">
9+
<x-base :meta-image-uri="uri([MetaImageController::class, 'blog'], slug: $post->slug)" :title="$post->title" :description="$post->description" :copy-code-blocks="true">
1010
<!-- Main container -->
1111
<main class="container px-4 mx-auto xl:px-8 flex flex-col grow isolate items-center relative">
1212
<!-- Main content -->

src/Web/x-base.view.php

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
11
<html lang="en" class="h-dvh flex flex-col scroll-smooth">
22
<head>
3-
<title :if="isset($fullTitle)">{{ $fullTitle }}</title>
4-
<title :elseif="isset($title)">{{ $title }} — Tempest</title>
5-
<title :else>Tempest</title>
3+
<!-- Meta title -->
4+
<?php $title = match (true) {
5+
isset($fullTitle) => $fullTitle,
6+
isset($title) => "{$title} — Tempest",
7+
default => 'Tempest',
8+
}; ?>
9+
10+
<title>{{ $title }}</title>
11+
<meta name="title" :content="$title">
12+
<meta name="twitter:title" :content="$title">
13+
<meta property="og:title" :content="$title">
14+
<meta itemprop="name" :content="$title">
615

716
<meta charset="UTF-8"/>
817
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
918

10-
<!-- Current meta image -->
11-
<?php
12-
$metaImageUri ??= ($meta ?? \App\Web\Meta\MetaType::HOME)->uri();
13-
?>
19+
<!-- Meta description -->
20+
<?php $description = match (true) {
21+
isset($description) => $description,
22+
default => 'The PHP framework that gets out of your way.',
23+
}; ?>
24+
25+
<meta name="description" :content="$description">
26+
<meta name="twitter:description" :content="$description">
27+
<meta property="og:description" :content="$description">
28+
<meta itemprop="description" :content="$description">
1429

15-
<!-- Social -->
16-
<meta property="og:image" content="<?= $metaImageUri ?>"/>
17-
<meta property="twitter:image" content="<?= $metaImageUri ?>"/>
18-
<meta name="image" content="<?= $metaImageUri ?>"/>
30+
<!-- Meta image -->
31+
<?php $metaImageUri ??= ($meta ?? \App\Web\Meta\MetaType::HOME)->uri(); ?>
32+
<meta property="og:image" :content="$metaImageUri"/>
33+
<meta property="twitter:image" :content="$metaImageUri"/>
34+
<meta name="image" :content="$metaImageUri"/>
1935
<meta name="twitter:card" content="summary_large_image"/>
36+
<meta property="og:type" content="article">
2037

2138
<!-- Favicon -->
2239
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png"/>

0 commit comments

Comments
 (0)