Replace hardcoded constants with variables from constants file
This commit is contained in:
parent
3431077897
commit
18e31d3121
10 changed files with 50 additions and 15 deletions
|
|
@ -5,6 +5,7 @@ import EmailFooterInput from "../ui/forms/input/EmailFooterInput.astro";
|
||||||
import enStrings from "@/utils/navigation.ts";
|
import enStrings from "@/utils/navigation.ts";
|
||||||
import frStrings from "@/utils/fr/navigation.ts";
|
import frStrings from "@/utils/fr/navigation.ts";
|
||||||
import Icon from "../ui/icons/Icon.astro";
|
import Icon from "../ui/icons/Icon.astro";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
// Select the correct translation based on the page's lang prop:
|
// Select the correct translation based on the page's lang prop:
|
||||||
const strings = Astro.currentLocale === "fr" ? frStrings : enStrings;
|
const strings = Astro.currentLocale === "fr" ? frStrings : enStrings;
|
||||||
|
|
@ -124,7 +125,7 @@ const crafted: string = Astro.currentLocale === "fr" ? "Fabriqué par" : "Crafte
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
||||||
© <span id="current-year"></span> ScrewFast. {crafted}
|
© <span id="current-year"></span> {SITE.title}. {crafted}
|
||||||
<a
|
<a
|
||||||
class="rounded-lg font-medium underline underline-offset-2 outline-none ring-zinc-500 transition duration-300 hover:text-neutral-700 hover:decoration-dashed focus:outline-none focus-visible:ring dark:ring-zinc-200 dark:hover:text-neutral-300"
|
class="rounded-lg font-medium underline underline-offset-2 outline-none ring-zinc-500 transition duration-300 hover:text-neutral-700 hover:decoration-dashed focus:outline-none focus-visible:ring dark:ring-zinc-200 dark:hover:text-neutral-300"
|
||||||
href="https://sobstvennoai.dev"
|
href="https://sobstvennoai.dev"
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@
|
||||||
import Meta from "@/components/Meta.astro";
|
import Meta from "@/components/Meta.astro";
|
||||||
import Navbar from "@/components/sections/Navbar.astro";
|
import Navbar from "@/components/sections/Navbar.astro";
|
||||||
import FooterSection from "@/components/sections/FooterSection.astro";
|
import FooterSection from "@/components/sections/FooterSection.astro";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
// Setting expected props
|
// Setting expected props
|
||||||
const { title = "ScrewFast", meta, structuredData, lang = "en" } = Astro.props;
|
const { title = SITE.title, meta, structuredData, lang = "en" } = Astro.props;
|
||||||
|
|
||||||
// Interface to type-check the properties
|
// Interface to type-check the properties
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -75,7 +76,7 @@ We set the language of the page to English and add classes for scrollbar and scr
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.lenis,
|
html.lenis,
|
||||||
html.lenis body {
|
html.lenis body {
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
// Import section components
|
// Import section components
|
||||||
import MainLayout from "@/layouts/MainLayout.astro";
|
import MainLayout from "@/layouts/MainLayout.astro";
|
||||||
import Btn404 from "@/components/ui/buttons/Btn404.astro";
|
import Btn404 from "@/components/ui/buttons/Btn404.astro";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
|
const pageTitle: string = `Page Not Found | ${SITE.title}`;
|
||||||
|
|
||||||
|
|
||||||
// Define variables for page content
|
// Define variables for page content
|
||||||
const title: string = "404";
|
const title: string = "404";
|
||||||
|
|
@ -12,7 +16,8 @@ const btnTitle: string = "Go Back";
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout
|
<MainLayout
|
||||||
title="Page Not Found | ScrewFast">
|
title={pageTitle}
|
||||||
|
>
|
||||||
<section class="grid h-svh place-content-center">
|
<section class="grid h-svh place-content-center">
|
||||||
<div class="mx-auto max-w-screen-xl px-4 py-8 lg:px-6 lg:py-16">
|
<div class="mx-auto max-w-screen-xl px-4 py-8 lg:px-6 lg:py-16">
|
||||||
<div class="mx-auto max-w-screen-sm text-center">
|
<div class="mx-auto max-w-screen-sm text-center">
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import { Image } from "astro:assets";
|
||||||
import { capitalize, formatDate } from "@/utils/utils";
|
import { capitalize, formatDate } from "@/utils/utils";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
import type { CollectionEntry } from "astro:content";
|
import type { CollectionEntry } from "astro:content";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
// getStaticPaths is used to pre-render all routes based on the blog posts
|
// getStaticPaths is used to pre-render all routes based on the blog posts
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
|
|
@ -32,9 +33,14 @@ const blogPosts: CollectionEntry<"blog">[] = await getCollection("blog");
|
||||||
const relatedPosts: CollectionEntry<"blog">[] = blogPosts.filter(
|
const relatedPosts: CollectionEntry<"blog">[] = blogPosts.filter(
|
||||||
(blogEntry) => blogEntry.slug !== post.slug
|
(blogEntry) => blogEntry.slug !== post.slug
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const pageTitle: string = `${post.data.title} | ${SITE.title}`;
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout title={post.data.title + " | ScrewFast"}>
|
<MainLayout
|
||||||
|
title={pageTitle}
|
||||||
|
>
|
||||||
<section 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">
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import CardBlogRecent from "@/components/ui/cards/CardBlogRecent.astro";
|
||||||
import CardInsight from "@/components/ui/cards/CardInsight.astro";
|
import CardInsight from "@/components/ui/cards/CardInsight.astro";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
import type { CollectionEntry } from "astro:content";
|
import type { CollectionEntry } from "astro:content";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
// Get all blogs post and sort them based on publish date
|
// Get all blogs post and sort them based on publish date
|
||||||
const blogPosts: CollectionEntry<"blog">[] = (await getCollection("blog")).sort(
|
const blogPosts: CollectionEntry<"blog">[] = (await getCollection("blog")).sort(
|
||||||
|
|
@ -15,7 +16,7 @@ const blogPosts: CollectionEntry<"blog">[] = (await getCollection("blog")).sort(
|
||||||
// Get all insights posts
|
// Get all insights posts
|
||||||
const insightPosts: CollectionEntry<"insights">[] =
|
const insightPosts: CollectionEntry<"insights">[] =
|
||||||
await getCollection("insights");
|
await getCollection("insights");
|
||||||
|
|
||||||
// Separate the most recent post from others
|
// Separate the most recent post from others
|
||||||
const mostRecentPost: CollectionEntry<"blog"> = blogPosts[0];
|
const mostRecentPost: CollectionEntry<"blog"> = blogPosts[0];
|
||||||
const otherPosts: CollectionEntry<"blog">[] = blogPosts.slice(1);
|
const otherPosts: CollectionEntry<"blog">[] = blogPosts.slice(1);
|
||||||
|
|
@ -27,10 +28,12 @@ const subTitle: string =
|
||||||
const secondTitle: string = "Insights";
|
const secondTitle: string = "Insights";
|
||||||
const secondSubTitle: string =
|
const secondSubTitle: string =
|
||||||
"Stay up-to-date with the latest trends and developments in the construction industry with insights from ScrewFast's team of industry experts. ";
|
"Stay up-to-date with the latest trends and developments in the construction industry with insights from ScrewFast's team of industry experts. ";
|
||||||
|
|
||||||
|
const pageTitle: string = `Blog | ${SITE.title}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout
|
<MainLayout
|
||||||
title="Blog | ScrewFast"
|
title={pageTitle}
|
||||||
structuredData={{
|
structuredData={{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebPage",
|
"@type": "WebPage",
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,14 @@
|
||||||
// Import the necessary components
|
// Import the necessary components
|
||||||
import MainLayout from "@/layouts/MainLayout.astro";
|
import MainLayout from "@/layouts/MainLayout.astro";
|
||||||
import ContactSection from "@/components/sections/ContactSection.astro";
|
import ContactSection from "@/components/sections/ContactSection.astro";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
|
const pageTitle: string = `Contact | ${SITE.title}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--Utilizing MainLayout for the outer layout of the page, and defining meta for SEO purposes-->
|
<!--Utilizing MainLayout for the outer layout of the page, and defining meta for SEO purposes-->
|
||||||
<MainLayout
|
<MainLayout
|
||||||
title="Contact | ScrewFast"
|
title={pageTitle}
|
||||||
structuredData={{
|
structuredData={{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebPage",
|
"@type": "WebPage",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
// Import section components
|
// Import section components
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
import MainLayout from "@/layouts/MainLayout.astro";
|
import MainLayout from "@/layouts/MainLayout.astro";
|
||||||
import { Image } from "astro:assets";
|
import { Image } from "astro:assets";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
|
|
@ -14,9 +15,13 @@ export async function getStaticPaths() {
|
||||||
}
|
}
|
||||||
// Get the props for this page that define a specific insight post
|
// Get the props for this page that define a specific insight post
|
||||||
const { post } = Astro.props;
|
const { post } = Astro.props;
|
||||||
|
|
||||||
|
const pageTitle: string = `${post.data.title} | ${SITE.title}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout title={post.data.title + " | ScrewFast"}>
|
<MainLayout
|
||||||
|
title={pageTitle}
|
||||||
|
>
|
||||||
<section 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">
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import ProductTabBtn from "@/components/ui/buttons/ProductTabBtn.astro";
|
||||||
import PrimaryCTA from "@/components/ui/buttons/PrimaryCTA.astro";
|
import PrimaryCTA from "@/components/ui/buttons/PrimaryCTA.astro";
|
||||||
import { Image } from "astro:assets";
|
import { Image } from "astro:assets";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
// Global declaration for gsap animation library
|
// Global declaration for gsap animation library
|
||||||
declare global {
|
declare global {
|
||||||
|
|
@ -22,9 +23,13 @@ export async function getStaticPaths() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const { product } = Astro.props;
|
const { product } = Astro.props;
|
||||||
|
|
||||||
|
const pageTitle: string = `${product.data.main.title} | ${SITE.title}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout title={product.data.main.title + " | ScrewFast"}>
|
<MainLayout
|
||||||
|
title={pageTitle}
|
||||||
|
>
|
||||||
<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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import TestimonialsSectionAlt from "@/components/sections/testimonials/Testimoni
|
||||||
// Importing necessary functions from Astro
|
// Importing necessary functions from Astro
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
import type { CollectionEntry } from "astro:content";
|
import type { CollectionEntry } from "astro:content";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
// Fetching all the product related content and sorting it by main.id
|
// Fetching all the product related content and sorting it by main.id
|
||||||
const product: CollectionEntry<"products">[] = (
|
const product: CollectionEntry<"products">[] = (
|
||||||
|
|
@ -57,10 +58,12 @@ const testimonials = [
|
||||||
avatarAlt: "Image Description",
|
avatarAlt: "Image Description",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const pageTitle: string = `Products | ${SITE.title}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout
|
<MainLayout
|
||||||
title="Products | ScrewFast"
|
title={pageTitle}
|
||||||
structuredData={{
|
structuredData={{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebPage",
|
"@type": "WebPage",
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import aerialView from "@/images/aerial-view.avif";
|
||||||
import usingTools from "@/images/using-tools.avif";
|
import usingTools from "@/images/using-tools.avif";
|
||||||
import progressBuilding from "@/images/progress-building.avif";
|
import progressBuilding from "@/images/progress-building.avif";
|
||||||
import underConstruction from "@/images/under-construction.avif";
|
import underConstruction from "@/images/under-construction.avif";
|
||||||
|
import { SITE } from "@/data_files/constants";
|
||||||
|
|
||||||
interface Article {
|
interface Article {
|
||||||
isRightSection: boolean;
|
isRightSection: boolean;
|
||||||
|
|
@ -90,10 +91,12 @@ const articles: Article[] = [
|
||||||
btnURL: "#",
|
btnURL: "#",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const pageTitle: string = `Services | ${SITE.title}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout
|
<MainLayout
|
||||||
title="Services | ScrewFast"
|
title={pageTitle}
|
||||||
structuredData={{
|
structuredData={{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebPage",
|
"@type": "WebPage",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue