From 7a609e4a5c7f3fec51d2ba76129e8f5449b597ec Mon Sep 17 00:00:00 2001 From: Emil Gulamov <125820963+mearashadowfax@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:41:42 +0400 Subject: [PATCH] Refactor components to 'sections' directory and improve SEO All component files have been moved to a newly created 'sections' directory for better organization. Changes in import paths are reflected in all dependent files. Also, implemented SEO enhancements by adding structured data and default meta descriptions to the Meta component, and adjusted it to accept these values as props from parent components. --- src/components/Meta.astro | 44 +++++++++++-------- .../{ => sections}/Authentication.astro | 0 .../{ => sections}/ClientsSection.astro | 0 .../{ => sections}/ContactSection.astro | 0 src/components/{ => sections}/FAQ.astro | 0 .../{ => sections}/FeaturesGeneral.astro | 0 .../{ => sections}/FeaturesNavs.astro | 0 .../{ => sections}/FeaturesStats.astro | 0 .../{ => sections}/FeaturesStatsAlt.astro | 0 .../{ => sections}/FooterSection.astro | 0 .../{ => sections}/HeroSection.astro | 0 .../{ => sections}/HeroSectionAlt.astro | 0 src/components/{ => sections}/Navbar.astro | 0 .../{ => sections}/PricingSection.astro | 0 .../{ => sections}/TestimonialsSection.astro | 0 .../TestimonialsSectionAlt.astro | 0 src/layouts/MainLayout.astro | 5 ++- src/pages/contact.astro | 2 +- src/pages/index.astro | 16 +++---- src/pages/products/index.astro | 9 ++-- src/pages/services.astro | 2 +- 21 files changed, 41 insertions(+), 37 deletions(-) rename src/components/{ => sections}/Authentication.astro (100%) rename src/components/{ => sections}/ClientsSection.astro (100%) rename src/components/{ => sections}/ContactSection.astro (100%) rename src/components/{ => sections}/FAQ.astro (100%) rename src/components/{ => sections}/FeaturesGeneral.astro (100%) rename src/components/{ => sections}/FeaturesNavs.astro (100%) rename src/components/{ => sections}/FeaturesStats.astro (100%) rename src/components/{ => sections}/FeaturesStatsAlt.astro (100%) rename src/components/{ => sections}/FooterSection.astro (100%) rename src/components/{ => sections}/HeroSection.astro (100%) rename src/components/{ => sections}/HeroSectionAlt.astro (100%) rename src/components/{ => sections}/Navbar.astro (100%) rename src/components/{ => sections}/PricingSection.astro (100%) rename src/components/{ => sections}/TestimonialsSection.astro (100%) rename src/components/{ => sections}/TestimonialsSectionAlt.astro (100%) 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}