diff --git a/src/components/Meta.astro b/src/components/Meta.astro index 8a0b35d..52c48bc 100644 --- a/src/components/Meta.astro +++ b/src/components/Meta.astro @@ -1,15 +1,26 @@ --- -// Assign a description using the `meta` prop passed from the parent component, -// `meta` is used as a variable on each individual page by passing it as a prop to this component. -// For example, you can pass a meta description to the MainLayout component like this: -const { meta: description } = Astro.props; +// Default properties for the Meta component. These values are used if props are not provided. +// 'title' sets the default page title for the website. +// 'meta' sets a default description meta tag to describe the page content. +// 'structuredData' defines default structured data in JSON-LD format to enhance search engine understanding of the page (for SEO purposes). +const defaultProps = { + title: "ScrewFast", // Default title + meta: "ScrewFast offers top-tier hardware tools and expert construction services to meet all your project needs. Start exploring and contact our sales team for superior quality and reliability.", + structuredData: { + "@context": "https://schema.org", + "@type": "WebSite", + "name": "ScrewFast", + "url": "https://screwfast.uk", + "description": "ScrewFast offers top-tier hardware tools and expert construction services to meet all your project needs. Start exploring and contact our sales team for superior quality and reliability.", + }, +}; -interface Props { - meta?: string; -} +// Extract props with default values assigned from defaultProps. Values can be overridden when the component is used. +// For example: +// +const { title = defaultProps.title, meta = defaultProps.meta, structuredData = defaultProps.structuredData } = Astro.props; // Define the metadata for your website and individual pages -const title: string = "ScrewFast"; // Set the website title const ogTitle: string = "ScrewFast: Hardware Tools & Construction Services"; // Set the Open Graph title const author: string = "Emil Gulamov"; // Set the author's name const ogDescription: string = @@ -18,19 +29,14 @@ const URL: string = "https://screwfast.uk"; // Set the website URL const socialImage: string = "https://screwfast.uk/social.png"; // Set the URL for the social media image --- - - + +{structuredData && ( + +)} - + - + {title}