2025-06-18 07:46:59 -04:00
|
|
|
---
|
|
|
|
|
interface Props {
|
|
|
|
|
title?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
image?: string;
|
2025-11-28 09:07:55 -05:00
|
|
|
isWhitelabel?: boolean;
|
2025-06-18 07:46:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
import { metaData } from "../config";
|
|
|
|
|
import { SEO } from "astro-seo";
|
|
|
|
|
import { JoyUIRootIsland } from "./Components"
|
2025-07-17 06:55:01 -04:00
|
|
|
import { useHtmlThemeAttr } from "../hooks/useHtmlThemeAttr";
|
2025-07-16 10:06:41 -04:00
|
|
|
import { usePrimeReactThemeSwitcher } from "../hooks/usePrimeReactThemeSwitcher";
|
|
|
|
|
|
2025-11-28 09:07:55 -05:00
|
|
|
const { title, description, image, isWhitelabel } = Astro.props;
|
2025-06-18 07:46:59 -04:00
|
|
|
|
2025-11-26 14:42:57 -05:00
|
|
|
const { url } = Astro;
|
|
|
|
|
|
2025-11-28 09:07:55 -05:00
|
|
|
const trimmedTitle = title?.trim();
|
|
|
|
|
const seoTitle = trimmedTitle || metaData.title;
|
|
|
|
|
const shareTitle = isWhitelabel ? (trimmedTitle || (metaData.shareTitle ?? metaData.title)) : (trimmedTitle ? `${trimmedTitle} | ${metaData.title}` : (metaData.shareTitle ?? metaData.title));
|
|
|
|
|
const seoTitleTemplate = isWhitelabel ? "%s" : (trimmedTitle ? `%s | ${metaData.title}` : "%s");
|
2025-11-26 14:42:57 -05:00
|
|
|
const shareDescription = description ?? metaData.shareDescription ?? metaData.description;
|
|
|
|
|
const canonicalUrl = url?.href ?? metaData.baseUrl;
|
|
|
|
|
const shareImage = new URL(image ?? metaData.ogImage, metaData.baseUrl).toString();
|
|
|
|
|
const shareImageAlt = metaData.shareImageAlt ?? metaData.shareTitle ?? metaData.title;
|
2025-06-18 07:46:59 -04:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
<SEO
|
2025-11-28 09:07:55 -05:00
|
|
|
title={seoTitle}
|
|
|
|
|
titleTemplate={seoTitleTemplate}
|
2025-06-18 07:46:59 -04:00
|
|
|
titleDefault={metaData.title}
|
2025-11-26 14:42:57 -05:00
|
|
|
description={shareDescription}
|
2025-06-18 07:46:59 -04:00
|
|
|
charset="UTF-8"
|
|
|
|
|
openGraph={{
|
|
|
|
|
basic: {
|
2025-11-26 14:42:57 -05:00
|
|
|
title: shareTitle,
|
2025-06-18 07:46:59 -04:00
|
|
|
type: "website",
|
2025-11-26 14:42:57 -05:00
|
|
|
image: shareImage,
|
|
|
|
|
url: canonicalUrl,
|
2025-06-18 07:46:59 -04:00
|
|
|
},
|
|
|
|
|
optional: {
|
2025-11-26 14:42:57 -05:00
|
|
|
description: shareDescription,
|
|
|
|
|
siteName: metaData.name,
|
2025-06-18 07:46:59 -04:00
|
|
|
locale: "en_US",
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
extend={{
|
2025-11-26 14:42:57 -05:00
|
|
|
link: [
|
|
|
|
|
{ rel: "icon", href: "https://codey.lol/images/favicon.png" },
|
|
|
|
|
{ rel: "canonical", href: canonicalUrl },
|
|
|
|
|
],
|
|
|
|
|
meta: [
|
|
|
|
|
{ property: "og:image:alt", content: shareImageAlt },
|
|
|
|
|
{ name: "twitter:card", content: "summary_large_image" },
|
|
|
|
|
{ name: "twitter:title", content: shareTitle },
|
|
|
|
|
{ name: "twitter:description", content: shareDescription },
|
|
|
|
|
{ name: "twitter:image", content: shareImage },
|
|
|
|
|
{ name: "twitter:image:alt", content: shareImageAlt },
|
|
|
|
|
],
|
2025-06-18 07:46:59 -04:00
|
|
|
}}
|
2025-07-16 10:06:41 -04:00
|
|
|
/>
|
|
|
|
|
|