From a9ccd095e86aae15a6924d9d94b63447283d9454 Mon Sep 17 00:00:00 2001 From: Ferran Date: Mon, 26 Aug 2024 17:00:02 +0200 Subject: [PATCH] perf: hardcoded strings unification --- astro.config.ts | 5 ++++- src/const/const.ts | 2 +- src/pages/index.astro | 1 - src/pages/projects.astro | 10 ++++++++++ .../aboutLatestArticles/AboutLatestArticles.astro | 2 +- src/ui/modules/home/components/myWork/MyWork.astro | 11 ++++++----- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/astro.config.ts b/astro.config.ts index 4411ef5e..c88ee8eb 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -131,7 +131,10 @@ export default defineConfig({ }), ], redirects: { - "/home": "/", + "/home": { + status: 301, + destination: "/", + }, }, output: "hybrid", adapter: cloudflare({ diff --git a/src/const/const.ts b/src/const/const.ts index a7b58b93..f5f8a20b 100644 --- a/src/const/const.ts +++ b/src/const/const.ts @@ -22,7 +22,7 @@ export const PAGES_ROUTES = { [Pages.ABOUT]: "/about", [Pages.TAGS]: "/tags", [Pages.CONTACT]: "/contact", - [Pages.PROJECTS]: "/contact", + [Pages.PROJECTS]: "/projects", [Pages.TERMS_AND_CONDITIONS]: "/terms-and-conditions", [Pages.PRIVACY_POLICY]: "/privacy-policy", [Pages.HOME]: "/", diff --git a/src/pages/index.astro b/src/pages/index.astro index 70832a2b..13fe86de 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -7,7 +7,6 @@ import Welcome from "@modules/home/components/welcome/Welcome.astro"; // todo: check metadata all pages // todo: add small transitions & animations -// - CTAs with arrow: animate arrow // - Latest articles (https://codepen.io/jh3y/pen/MWLyGxo) // todo: wait for wrangler webhook --> add Algolia + filters (+ URL filtering) https://www.algolia.com/developers/contentful-search-algolia/ (webhook problem) // todo: how to deploy cloudfare pages diff --git a/src/pages/projects.astro b/src/pages/projects.astro index a712be53..a1d23234 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -4,6 +4,7 @@ import { getCollection } from "astro:content"; import BaseLayout from "@modules/core/components/baseLayout/BaseLayout.astro"; import ProjectSection from "@modules/projects/components/projectSection/ProjectSection.astro"; import ProjectsIntro from "@modules/projects/components/projectsIntro/ProjectsIntro.astro"; +import { PAGES_ROUTES } from 'src/const'; const projects = await getCollection("projects"); --- @@ -21,6 +22,15 @@ const projects = await getCollection("projects");
+