Skip to content

Commit 1235fda

Browse files
fix: change title
1 parent 00d2a2f commit 1235fda

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/layouts/layout.astro

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,27 @@ import { Navigation } from "../components/dynamic/common/navigation";
88
import { Breadcrumbs } from "../components/dynamic/common/breadcrumbs";
99
import { Logo } from "../components/dynamic/common/logo";
1010
import { Preloader } from "../components/dynamic/common/preloader";
11+
12+
interface Props {
13+
title?: string;
14+
}
15+
16+
const { title } = Astro.props;
1117
---
1218

1319
<html lang="en">
1420
<head>
15-
<meta charset="UTF-8" />
16-
<meta name="viewport" content="width=device-width" />
21+
<meta charset="utf-8" />
1722
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
23+
<meta name="viewport" content="width=device-width" />
1824
<meta name="generator" content={Astro.generator} />
1925
<title>
20-
{Astro.url.pathname === "/" ? "index" : Astro.url.pathname.split("/")[1]}
21-
Ilya Dyomin
26+
{
27+
title ||
28+
(Astro.url.pathname === "/"
29+
? "index"
30+
: Astro.url.pathname.split("/")[1])
31+
} • Ilya Dyomin
2232
</title>
2333
<!-- SEO Meta Tags -->
2434
<meta

src/pages/notes/[...slug].astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,10 @@ export function getStaticPaths() {
186186
];
187187
}
188188
189-
const { slug } = Astro.params;
190189
const { title, content, date, tags } = Astro.props;
191190
---
192191

193-
<Layout>
192+
<Layout title={title}>
194193
<NoteContent
195194
client:load
196195
title={title}

0 commit comments

Comments
 (0)