Skip to content

Commit dd34376

Browse files
committed
Revert title related changes
1 parent dc84f1d commit dd34376

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/components/BaseHead.astro

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
import "@/styles/globals.css";
3-
import { getEntryBySlug } from 'astro:content';
43
import { CONFIG } from "@/config";
54
65
export type Props = {
@@ -15,18 +14,9 @@ const {
1514
image = CONFIG.meta.image,
1615
pageType = "website",
1716
} = Astro.props;
18-
19-
const getTitle = async (slug) => {
20-
if (Astro.props.title) return Astro.props.title;
21-
22-
if (!slug) return CONFIG.meta.title; // Fallback if no slug is provided
23-
24-
const post = await getEntryBySlug('blog', slug);
25-
return post?.data.title || CONFIG.meta.title;
26-
};
27-
28-
const title = await getTitle(Astro.params?.slug);
29-
17+
const title = Astro.props.title
18+
? `${Astro.props.title} - ${CONFIG.meta.title}`
19+
: CONFIG.meta.title;
3020
const resolvedImage = image?.src
3121
? {
3222
src: new URL(image.src, Astro.site).toString(),

0 commit comments

Comments
 (0)