Replace div tags with section tags in various components

The div HTML tags in various components of the project have been replaced with more appropriate section tags for better semantic structure. This affects the TestimonialsSection, Products, FeaturesStats, and several other components. Options for minifying JavaScript in the process-html file have also been updated. In the MainLayout, a main tag has been added to wrap page content for better accessibility and semantics.
This commit is contained in:
Emil Gulamov 2024-02-19 09:36:37 +04:00
parent e3888b18cb
commit 2d2bada884
19 changed files with 58 additions and 2438 deletions

View file

@ -15,7 +15,8 @@ await Promise.all(
html = minify(html, { html = minify(html, {
removeComments: true, removeComments: true,
preserveLineBreaks: true, preserveLineBreaks: true,
collapseWhitespace: true collapseWhitespace: true,
minifyJS: true
}) })
await fs.writeFile(file, html) await fs.writeFile(file, html)
}) })

File diff suppressed because it is too large Load diff

View file

@ -18,7 +18,7 @@ const formSubTitle: string = "We'll get back to you in 1-2 business days.";
--- ---
<!-- Contact Us --> <!-- Contact Us -->
<div class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14"> <section class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<div class="mx-auto max-w-2xl lg:max-w-5xl"> <div class="mx-auto max-w-2xl lg:max-w-5xl">
<div class="text-center"> <div class="text-center">
<h1 <h1
@ -168,4 +168,4 @@ const formSubTitle: string = "We'll get back to you in 1-2 business days.";
</div> </div>
</div> </div>
</div> </div>
</div> </section>

View file

@ -47,7 +47,7 @@ const faqs = [
--- ---
<!-- Main container that holds all content. Customized for different viewport sizes. --> <!-- Main container that holds all content. Customized for different viewport sizes. -->
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<div class="grid gap-10 md:grid-cols-5"> <div class="grid gap-10 md:grid-cols-5">
@ -93,7 +93,7 @@ const faqs = [
</div> </div>
</div> </div>
</div> </div>
</div> </section>
<!--Import the necessary Accordion plugin--> <!--Import the necessary Accordion plugin-->
<!--https://preline.co/plugins/html/accordion.html--> <!--https://preline.co/plugins/html/accordion.html-->
<script is:inline src="/scripts/vendor/preline/accordion/index.js"></script> <script is:inline src="/scripts/vendor/preline/accordion/index.js"></script>

View file

@ -10,7 +10,7 @@ const subTitle: string =
"At ScrewFast, we tackle the unique challenges encountered in the hardware and construction sectors. From cutting-edge tools to expert services, we're dedicated to helping you overcome obstacles and achieve your goals."; "At ScrewFast, we tackle the unique challenges encountered in the hardware and construction sectors. From cutting-edge tools to expert services, we're dedicated to helping you overcome obstacles and achieve your goals.";
--- ---
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<!-- Block to display the feature image --> <!-- Block to display the feature image -->
@ -112,4 +112,4 @@ const subTitle: string =
</div> </div>
</div> </div>
</div> </div>
</div> </section>

View file

@ -10,7 +10,7 @@ import dashboard from "../images/dashboard-image.avif";
const title: string = `Customize <span class="text-yellow-500 dark:text-yellow-400">ScrewFast</span>'s offerings to perfectly suit your hardware and construction needs.`; const title: string = `Customize <span class="text-yellow-500 dark:text-yellow-400">ScrewFast</span>'s offerings to perfectly suit your hardware and construction needs.`;
--- ---
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<div class="relative p-6 md:p-16"> <div class="relative p-6 md:p-16">
@ -125,7 +125,7 @@ const title: string = `Customize <span class="text-yellow-500 dark:text-yellow-4
</div> </div>
</div> </div>
</div> </div>
</div> </section>
<!--Import the necessary Tabs plugin--> <!--Import the necessary Tabs plugin-->
<!--https://preline.co/plugins/html/tabs.html--> <!--https://preline.co/plugins/html/tabs.html-->
<script is:inline src="/scripts/vendor/preline/tabs/index.js"></script> <script is:inline src="/scripts/vendor/preline/tabs/index.js"></script>

View file

@ -33,7 +33,7 @@ const stats: Stat[] = [
]; ];
--- ---
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<div class="max-w-screen-md"> <div class="max-w-screen-md">
@ -75,4 +75,4 @@ const stats: Stat[] = [
</div> </div>
</div> </div>
</div> </div>
</div> </section>

View file

@ -17,7 +17,7 @@ const benefits: string[] = [
const ListItemMarker: string = `<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="mt-0.5 h-6 w-6 text-[#fa5a15] dark:text-[#fb713b]"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>`; const ListItemMarker: string = `<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="mt-0.5 h-6 w-6 text-[#fa5a15] dark:text-[#fb713b]"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>`;
--- ---
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<!-- Grid --> <!-- Grid -->
@ -53,4 +53,4 @@ const ListItemMarker: string = `<svg fill="none" viewBox="0 0 24 24" stroke-widt
</div> </div>
</div> </div>
</div> </div>
</div> </section>

View file

@ -23,7 +23,7 @@ const reviews: string = "12.8k";
--- ---
<!-- Defining a grid container that holds all the content --> <!-- Defining a grid container that holds all the content -->
<div <section
class="mx-auto grid max-w-[85rem] gap-4 px-4 py-14 sm:px-6 md:grid-cols-2 md:items-center md:gap-8 lg:px-8 2xl:max-w-full" class="mx-auto grid max-w-[85rem] gap-4 px-4 py-14 sm:px-6 md:grid-cols-2 md:items-center md:gap-8 lg:px-8 2xl:max-w-full"
> >
<!-- Title and description --> <!-- Title and description -->
@ -124,4 +124,4 @@ const reviews: string = "12.8k";
/> />
</div> </div>
</div> </div>
</div> </section>

View file

@ -8,7 +8,7 @@ const subTitle: string =
"ScrewFast is an open-source template, meticulously crafted with Astro, Tailwind CSS, and Preline UI frameworks."; "ScrewFast is an open-source template, meticulously crafted with Astro, Tailwind CSS, and Preline UI frameworks.";
--- ---
<div class="relative mx-auto max-w-[85rem] px-4 pb-24 pt-10 sm:px-6 lg:px-8"> <section class="relative mx-auto max-w-[85rem] px-4 pb-24 pt-10 sm:px-6 lg:px-8">
<!-- Decorating SVG elements --> <!-- Decorating SVG elements -->
<div <div
class="absolute left-0 top-[55%] scale-90 md:top-[20%] xl:left-[10%] xl:top-[25%]" class="absolute left-0 top-[55%] scale-90 md:top-[20%] xl:left-[10%] xl:top-[25%]"
@ -128,4 +128,4 @@ const subTitle: string =
<div class="mt-8 flex justify-center gap-3"> <div class="mt-8 flex justify-center gap-3">
<GithubBtn url="https://github.com/mearashadowfax/ScrewFast" /> <GithubBtn url="https://github.com/mearashadowfax/ScrewFast" />
</div> </div>
</div> </section>

View file

@ -51,7 +51,7 @@ const professionalToolbox: Product = {
}; };
--- ---
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<!-- Section heading and sub-heading --> <!-- Section heading and sub-heading -->
@ -187,4 +187,4 @@ const professionalToolbox: Product = {
<SecondaryCTA title="Get a Custom Quote" url="#" /> <SecondaryCTA title="Get a Custom Quote" url="#" />
</div> </div>
</div> </section>

View file

@ -52,7 +52,7 @@ const statistics: StatProps[] = [
]; ];
--- ---
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<!-- Container for the testimonials --> <!-- Container for the testimonials -->
@ -156,4 +156,4 @@ const statistics: StatProps[] = [
</div> </div>
</div> </div>
</div> </div>
</div> </section>

View file

@ -49,7 +49,7 @@ const testimonials: Testimonial[] = [
]; ];
--- ---
<!-- Main div that wraps the testimonials section --> <!-- Main div that wraps the testimonials section -->
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
id="testimonials" id="testimonials"
> >
@ -97,4 +97,4 @@ const testimonials: Testimonial[] = [
)) ))
} }
</div> </div>
</div> </section>

View file

@ -58,7 +58,9 @@ We set the language of the page to English and add classes for scrollbar and scr
--> -->
<div class="mx-auto max-w-screen-2xl px-4 sm:px-6 lg:px-8"> <div class="mx-auto max-w-screen-2xl px-4 sm:px-6 lg:px-8">
<Navbar /> <Navbar />
<main>
<slot /> <slot />
</main>
</div> </div>
<FooterSection /> <FooterSection />
<style> <style>

View file

@ -34,7 +34,7 @@ const relatedPosts: CollectionEntry<"blog">[] = blogPosts.filter(
title={post.data.title + " | ScrewFast"} title={post.data.title + " | ScrewFast"}
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." 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."
> >
<div class="mx-auto max-w-3xl px-4 pb-12 pt-6 sm:px-6 lg:px-8 lg:pt-10"> <section class="mx-auto max-w-3xl px-4 pb-12 pt-6 sm:px-6 lg:px-8 lg:pt-10">
<div class="max-w-2xl"> <div class="max-w-2xl">
<div class="mb-6 flex items-center justify-between"> <div class="mb-6 flex items-center justify-between">
<div class="flex w-full gap-x-5 sm:items-center sm:gap-x-3"> <div class="flex w-full gap-x-5 sm:items-center sm:gap-x-3">
@ -111,9 +111,9 @@ const relatedPosts: CollectionEntry<"blog">[] = blogPosts.filter(
} }
</div> </div>
</div> </div>
</div> </section>
<!--Related articles section--> <!--Related articles section-->
<div class="mx-auto max-w-3xl px-4 py-10 sm:px-6 lg:px-8 lg:py-14"> <section class="mx-auto max-w-3xl px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<div class="mb-10 max-w-2xl"> <div class="mb-10 max-w-2xl">
<h2 <h2
class="text-balance text-2xl font-bold text-neutral-800 dark:text-neutral-200 md:text-4xl md:leading-tight" class="text-balance text-2xl font-bold text-neutral-800 dark:text-neutral-200 md:text-4xl md:leading-tight"
@ -125,5 +125,5 @@ const relatedPosts: CollectionEntry<"blog">[] = blogPosts.filter(
<div class="grid grid-cols-2 gap-6"> <div class="grid grid-cols-2 gap-6">
{relatedPosts.map((entry) => <CardRelated blogEntry={entry} />)} {relatedPosts.map((entry) => <CardRelated blogEntry={entry} />)}
</div> </div>
</div> </section>
</MainLayout> </MainLayout>

View file

@ -33,7 +33,7 @@ const secondSubTitle: string =
title="Blog | ScrewFast" title="Blog | ScrewFast"
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." 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."
> >
<div <section
class="mx-auto max-w-[85rem] space-y-8 px-4 pt-16 sm:px-6 lg:px-8 2xl:max-w-full" class="mx-auto max-w-[85rem] space-y-8 px-4 pt-16 sm:px-6 lg:px-8 2xl:max-w-full"
> >
<!--Page header--> <!--Page header-->
@ -50,24 +50,24 @@ const secondSubTitle: string =
{subTitle} {subTitle}
</p> </p>
</div> </div>
</div> </section>
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<!--Blog posts grid--> <!--Blog posts grid-->
<div class="grid gap-6 lg:grid-cols-2"> <div class="grid gap-6 lg:grid-cols-2">
{otherPosts.map((blogEntry) => <CardBlog blogEntry={blogEntry} />)} {otherPosts.map((blogEntry) => <CardBlog blogEntry={blogEntry} />)}
</div> </div>
</div> </section>
<!--Most recent blog post--> <!--Most recent blog post-->
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<CardBlogRecent blogEntry={mostRecentPost} /> <CardBlogRecent blogEntry={mostRecentPost} />
</div> </section>
<!--Insights section--> <!--Insights section-->
<div <section
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14"> <div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14">
@ -87,5 +87,5 @@ const secondSubTitle: string =
)) ))
} }
</div> </div>
</div> </section>
</MainLayout> </MainLayout>

View file

@ -20,7 +20,7 @@ const { post } = Astro.props;
title={post.data.title + " | ScrewFast"} title={post.data.title + " | ScrewFast"}
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." 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."
> >
<div class="py-6 sm:py-8 lg:py-12"> <section class="py-6 sm:py-8 lg:py-12">
<div class="mx-auto max-w-screen-xl px-4 md:px-8"> <div class="mx-auto max-w-screen-xl px-4 md:px-8">
<div class="grid gap-8 md:grid-cols-2 lg:gap-12"> <div class="grid gap-8 md:grid-cols-2 lg:gap-12">
<div> <div>
@ -53,5 +53,5 @@ const { post } = Astro.props;
</div> </div>
</div> </div>
</div> </div>
</div> </section>
</MainLayout> </MainLayout>

View file

@ -31,7 +31,7 @@ const { product } = Astro.props;
<div id="overlay" class="fixed inset-0 bg-neutral-200 dark:bg-neutral-800"> <div id="overlay" class="fixed inset-0 bg-neutral-200 dark:bg-neutral-800">
</div> </div>
<div <section
class="mx-auto flex max-w-[85rem] flex-col px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full" class="mx-auto flex max-w-[85rem] flex-col px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
> >
<div> <div>
@ -66,7 +66,7 @@ const { product } = Astro.props;
/> />
</div> </div>
</div> </div>
</div> </section>
<div class="mx-auto max-w-[85rem] px-4 pt-10 sm:px-6 lg:px-8 lg:pt-14"> <div class="mx-auto max-w-[85rem] px-4 pt-10 sm:px-6 lg:px-8 lg:pt-14">
<nav <nav

View file

@ -51,7 +51,7 @@ const subTitle: string =
</div> </div>
<!--Displaying products in alternating styles. Alternative product gets different card styling.--> <!--Displaying products in alternating styles. Alternative product gets different card styling.-->
<!--Maps through all product entries and displays them with either CardSmall or CardWide based on their position.--> <!--Maps through all product entries and displays them with either CardSmall or CardWide based on their position.-->
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3 md:gap-6 xl:gap-8"> <section class="grid grid-cols-1 gap-4 sm:grid-cols-3 md:gap-6 xl:gap-8">
{ {
product.map((product, index) => { product.map((product, index) => {
const position = index % 4; const position = index % 4;
@ -62,7 +62,7 @@ const subTitle: string =
} }
}) })
} }
</div> </section>
</div> </div>
<!--Features statistics section--> <!--Features statistics section-->
<FeaturesStatsAlt /> <FeaturesStatsAlt />