feat(seo): add keywords meta tag support for improved SEO
- Introduced keywords property in layout and page server files to enhance SEO capabilities. - Updated relevant components to include keywords in meta tags for better search engine visibility.
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
seoDescription?: string;
|
seoDescription?: string;
|
||||||
socialImage?: string;
|
socialImage?: string;
|
||||||
robots?: string;
|
robots?: string;
|
||||||
|
keywords?: string;
|
||||||
jsonLd?: Record<string, unknown> | Record<string, unknown>[];
|
jsonLd?: Record<string, unknown> | Record<string, unknown>[];
|
||||||
breadcrumbItems?: { href?: string; label: string }[];
|
breadcrumbItems?: { href?: string; label: string }[];
|
||||||
topBanner?: {
|
topBanner?: {
|
||||||
@@ -185,6 +186,9 @@
|
|||||||
{#if seoDescription}
|
{#if seoDescription}
|
||||||
<meta name="description" content={seoDescription} />
|
<meta name="description" content={seoDescription} />
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if pageData?.keywords}
|
||||||
|
<meta name="keywords" content={pageData.keywords} />
|
||||||
|
{/if}
|
||||||
<link rel="canonical" href={canonical} />
|
<link rel="canonical" href={canonical} />
|
||||||
<!-- Open Graph -->
|
<!-- Open Graph -->
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
|
|||||||
@@ -112,5 +112,6 @@ export const load: PageServerLoad = async ({ locals, fetch }) => {
|
|||||||
: siteName,
|
: siteName,
|
||||||
seoDescription: page ? (page.seoDescription ?? page.subheadline ?? '') : '',
|
seoDescription: page ? (page.seoDescription ?? page.subheadline ?? '') : '',
|
||||||
robots: (page as { seoMetaRobots?: string } | null)?.seoMetaRobots ?? undefined,
|
robots: (page as { seoMetaRobots?: string } | null)?.seoMetaRobots ?? undefined,
|
||||||
|
keywords: (page as { seoKeywords?: string } | null)?.seoKeywords ?? undefined,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export const load: PageServerLoad = async ({ params, locals, fetch }) => {
|
|||||||
seoTitle: page.seoTitle ?? page.headline ?? page.linkName ?? slug,
|
seoTitle: page.seoTitle ?? page.headline ?? page.linkName ?? slug,
|
||||||
seoDescription: page.seoDescription ?? page.subheadline ?? '',
|
seoDescription: page.seoDescription ?? page.subheadline ?? '',
|
||||||
robots: (page as { seoMetaRobots?: string }).seoMetaRobots ?? undefined,
|
robots: (page as { seoMetaRobots?: string }).seoMetaRobots ?? undefined,
|
||||||
|
keywords: (page as { seoKeywords?: string }).seoKeywords ?? undefined,
|
||||||
breadcrumbItems: [
|
breadcrumbItems: [
|
||||||
{ href: '/', label: 'Start' },
|
{ href: '/', label: 'Start' },
|
||||||
{ label: page.headline ?? page.linkName ?? page.slug ?? page._slug ?? slug },
|
{ label: page.headline ?? page.linkName ?? page.slug ?? page._slug ?? slug },
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ export const load: PageServerLoad = async ({ params, locals, url }) => {
|
|||||||
seoDescription: postDescription,
|
seoDescription: postDescription,
|
||||||
socialImage: postSocialImageAbs ?? postImageUrl ?? undefined,
|
socialImage: postSocialImageAbs ?? postImageUrl ?? undefined,
|
||||||
robots: (post as { seoMetaRobots?: string }).seoMetaRobots ?? undefined,
|
robots: (post as { seoMetaRobots?: string }).seoMetaRobots ?? undefined,
|
||||||
|
keywords: (post as { seoKeywords?: string }).seoKeywords ?? undefined,
|
||||||
jsonLd,
|
jsonLd,
|
||||||
breadcrumbItems: [
|
breadcrumbItems: [
|
||||||
{ href: '/', label: 'Start' },
|
{ href: '/', label: 'Start' },
|
||||||
|
|||||||
Reference in New Issue
Block a user