diff --git a/src/components/Meta.astro b/src/components/Meta.astro index 7589e23..f4cca90 100644 --- a/src/components/Meta.astro +++ b/src/components/Meta.astro @@ -1,8 +1,7 @@ --- import { getImage } from "astro:assets"; import { OG, SEO, SITE } from "@data/constants"; -import faviconSvgSrc from "@images/icon.svg"; -import faviconSrc from "@images/icon.png"; +import faviconSrc from "@images/favicon.png"; // Default properties for the Meta component. These values are used if props are not provided. // 'meta' sets a default description meta tag to describe the page content. @@ -60,11 +59,6 @@ const alternateLanguageLinks: string = Object.entries(languages) }) .join("\n"); -// Generate and optimize the favicon images -const faviconSvg = await getImage({ - src: faviconSvgSrc, - format: "svg", -}); const appleTouchIcon = await getImage({ src: faviconSrc, @@ -122,7 +116,6 @@ const appleTouchIcon = await getImage({ - diff --git a/src/images/favicon.png b/src/images/favicon.png new file mode 100644 index 0000000..450e7f1 Binary files /dev/null and b/src/images/favicon.png differ diff --git a/src/pages/favicon.ico.ts b/src/pages/favicon.ico.ts index 6347f84..5aea5da 100644 --- a/src/pages/favicon.ico.ts +++ b/src/pages/favicon.ico.ts @@ -3,20 +3,16 @@ import sharp from "sharp"; import ico from "sharp-ico"; import path from "node:path"; -const faviconSrc = path.resolve("src/images/icon.png"); +const faviconSrc = path.resolve("src/images/favicon.png"); export const GET: APIRoute = async () => { - // Resize the image to multiple sizes const sizes = [16, 32]; const buffers = await Promise.all( sizes.map(async (size) => { - return await sharp(faviconSrc) - .resize(size) - .toFormat("png") - .toBuffer(); - }) + return await sharp(faviconSrc).resize(size).toFormat("png").toBuffer(); + }), ); // Convert the image to an ICO file diff --git a/src/pages/insights/[id].astro b/src/pages/insights/[id].astro deleted file mode 100644 index 95f6b90..0000000 --- a/src/pages/insights/[id].astro +++ /dev/null @@ -1,268 +0,0 @@ ---- -// Import section components -import { SITE } from "@data/constants"; -import MainLayout from "@/layouts/MainLayout.astro"; -import { Image } from "astro:assets"; -import { getCollection, render } from "astro:content"; - -// Use `getStaticPaths` to generate static routes for generated pages on build -export async function getStaticPaths() { - const insightPosts = await getCollection("insights", ({ id }) => - id.startsWith("en/") - ); - return insightPosts.map((post) => { - const idWithoutLang = post.id.replace(/^en\//, ""); // Remove the "fr/" prefix - return { - params: { id: idWithoutLang }, - props: { post }, - }; - }); -} - -// Get the props for this page that define a specific insight post -const { post } = Astro.props; - -const { Content } = await render(post); - -const pageTitle: string = `${post.data.title} | ${SITE.title}`; ---- - - -
-
-
-
-
- {post.data.cardImageAlt} -
-
-
- -
- -
-

- {post.data.title} -

- -
- -
-
-
-
-
-
- - - - - diff --git a/src/pages/manifest.json.ts b/src/pages/manifest.json.ts index a73c0cf..01b61b6 100644 --- a/src/pages/manifest.json.ts +++ b/src/pages/manifest.json.ts @@ -1,10 +1,10 @@ import type { APIRoute, ImageMetadata } from "astro"; import { getImage } from "astro:assets"; -import icon from "@images/icon.png"; +import icon from "@images/favicon.png"; import maskableIcon from "@images/icon-maskable.png"; interface Favicon { - purpose: 'any' | 'maskable' | 'monochrome'; + purpose: "any" | "maskable" | "monochrome"; src: ImageMetadata; sizes: number[]; } @@ -12,15 +12,15 @@ interface Favicon { const sizes = [192, 512]; const favicons: Favicon[] = [ { - purpose: 'any', + purpose: "any", src: icon, sizes, }, { - purpose: 'maskable', + purpose: "maskable", src: maskableIcon, sizes, - }, + }, ]; export const GET: APIRoute = async () => { diff --git a/src/pages/products/[id].astro b/src/pages/products/[id].astro deleted file mode 100644 index ccdab53..0000000 --- a/src/pages/products/[id].astro +++ /dev/null @@ -1,392 +0,0 @@ ---- -// Import section components -import MainLayout from "@/layouts/MainLayout.astro"; -import ProductTabBtn from "@components/ui/buttons/ProductTabBtn.astro"; -import PrimaryCTA from "@components/ui/buttons/PrimaryCTA.astro"; -import { Image } from "astro:assets"; -import { getCollection } from "astro:content"; -import { SITE } from "@data/constants"; - -// Global declaration for gsap animation library -declare global { - interface Window { - gsap: any; - } -} - -// This gets the static paths for all the unique products - -export async function getStaticPaths() { - const productEntries = await getCollection("products", ({ id }) => - id.startsWith("en/") - ); - return productEntries.map((product) => { - const idWithoutLang = product.id.replace(/^en\//, ""); // Remove the "en/" prefix - return { - params: { id: idWithoutLang }, - props: { product }, - }; - }); -} - -const { product } = Astro.props; - -const pageTitle: string = `${product.data.title} | ${SITE.title}`; ---- - - -
-
- -
-
-

- {product.data.main.content} -

-
-
-
-

- {product.data.title} -

-

- {product.data.description} -

-
-
- {product.data.main.imgAlt} -
-
-
- -
- - -
-
-
-
-
-

- {product.data.longDescription.title} -

-

- {product.data.longDescription.subTitle} -

-

- -

-
- -
- { - product.data.descriptionList.map((list) => ( -
-
-

- {list.title} -

-

- {list.subTitle} -

-
-
- )) - } -
-
-
-
- - -
-
- - -
- - - diff --git a/src/pages/products/index.astro b/src/pages/products/index.astro deleted file mode 100644 index 6a10874..0000000 --- a/src/pages/products/index.astro +++ /dev/null @@ -1,135 +0,0 @@ ---- -// Importing necessary components -import MainLayout from "@/layouts/MainLayout.astro"; -import PrimaryCTA from "@components/ui/buttons/PrimaryCTA.astro"; -import CardSmall from "@components/ui/cards/CardSmall.astro"; -import CardWide from "@components/ui/cards/CardWide.astro"; -import FeaturesStatsAlt from "@components/sections/features/FeaturesStatsAlt.astro"; -import TestimonialsSectionAlt from "@components/sections/testimonials/TestimonialsSectionAlt.astro"; - -// Importing necessary functions from Astro -import { getCollection } from "astro:content"; -import type { CollectionEntry } from "astro:content"; -import { SITE } from "@data/constants"; - -// Fetching all the product related content and sorting it by main.id -const product: CollectionEntry<"products">[] = ( - await getCollection("products", ({ id }) => { - return id.startsWith("en/"); - }) -).sort( - (a: CollectionEntry<"products">, b: CollectionEntry<"products">) => - a.data.main.id - b.data.main.id, -); - -// Define variables for page content -const title: string = "Products"; -const subTitle: string = - "Explore the durability and precision of ScrewFast tools, designed for both professionals and enthusiasts. Each of our products is crafted with precision and built to last, ensuring you have the right tool for every job."; - -// Testimonial data that will be rendered in the component -const testimonials = [ - // First testimonial data - { - content: - " \"Since switching to ScrewFast's hardware tools, the efficiency on our construction sites has skyrocketed. The durability of the hex bolts and precision of the machine screws are simply unmatched. It's refreshing to work with a company that truly understands the daily demands of the industry.\" ", - author: "Jason Clark", - role: "Site Foreman | TopBuild", - avatarSrc: - "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=1374&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=facearea&facepad=2&w=320&h=320&q=80", - avatarAlt: "Image Description", - }, - // Second testimonial data - { - content: - " \"As an interior designer, I'm always looking for high-quality materials and tools that help bring my visions to life. ScrewFast's mixed screws assortment has been a game-changer for my projects, providing the perfect blend of quality and variety. The outstanding customer support was just the cherry on top!\" ", - author: "Maria Gonzalez", - role: "Interior Designer | Creative Spaces", - avatarSrc: - "https://images.unsplash.com/photo-1544005313-94ddf0286df2?q=80&w=1376&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D8&auto=format&fit=facearea&facepad=2&w=320&h=320&q=80", - avatarAlt: "Image Description", - }, - // Third testimonial data - { - content: - " \"I’ve been a professional carpenter for over 15 years, and I can sincerely say that ScrewFast’s tap bolts and nuts are some of the best I've used. They grip like no other, and I have full confidence in every joint and fixture. Plus, the service is impeccable – they truly care about my project's success.\" ", - author: "Richard Kim", - role: "Master Carpenter | WoodWright", - avatarSrc: - "https://images.unsplash.com/photo-1474176857210-7287d38d27c6?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D8&auto=format&fit=facearea&facepad=2&w=320&h=320&q=80", - avatarAlt: "Image Description", - }, -]; - -const pageTitle: string = `Products | ${SITE.title}`; ---- - - -
-
-
-

- {title} -

- { - subTitle && ( - - ) - } -
- -
- - -
- { - product.map((product, index) => { - const position = index % 4; - if (position === 0 || position === 3) { - return ; - } else { - return ; - } - }) - } -
-
- - - - -