From e1c3ae7d8757d9f62ef36372df191876aba60a4c Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Sun, 16 Feb 2025 12:01:51 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Latest=20projects=20on=20landing=20?= =?UTF-8?q?page,=20moved=20landing=20page=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/{ => landing}/Greeting.astro | 0 src/components/landing/IndexPage.astro | 7 +++++ src/components/landing/LatestProjects.astro | 10 ++++++ src/components/projects/MyProjectsPage.astro | 24 ++------------- src/components/projects/ProjectGrid.astro | 32 ++++++++++++++++++++ src/pages/en/index.astro | 6 ++-- src/pages/index.astro | 7 ++--- 7 files changed, 57 insertions(+), 29 deletions(-) rename src/components/{ => landing}/Greeting.astro (100%) create mode 100644 src/components/landing/IndexPage.astro create mode 100644 src/components/landing/LatestProjects.astro create mode 100644 src/components/projects/ProjectGrid.astro diff --git a/src/components/Greeting.astro b/src/components/landing/Greeting.astro similarity index 100% rename from src/components/Greeting.astro rename to src/components/landing/Greeting.astro diff --git a/src/components/landing/IndexPage.astro b/src/components/landing/IndexPage.astro new file mode 100644 index 0000000..12298dc --- /dev/null +++ b/src/components/landing/IndexPage.astro @@ -0,0 +1,7 @@ +--- +import Greeting from "./Greeting.astro" +import LatestProjects from "./LatestProjects.astro" +--- + + + diff --git a/src/components/landing/LatestProjects.astro b/src/components/landing/LatestProjects.astro new file mode 100644 index 0000000..8494c20 --- /dev/null +++ b/src/components/landing/LatestProjects.astro @@ -0,0 +1,10 @@ +--- +import { getCollection } from "astro:content" +import ProjectGrid from "@/components/projects/ProjectGrid.astro" + +const projects = await getCollection("projects") +--- + +
+ + diff --git a/src/components/projects/MyProjectsPage.astro b/src/components/projects/MyProjectsPage.astro index 4503ef4..92d16ad 100644 --- a/src/components/projects/MyProjectsPage.astro +++ b/src/components/projects/MyProjectsPage.astro @@ -1,32 +1,12 @@ --- -import ProjectCard from "./ProjectCard.astro" +import ProjectGrid from "./ProjectGrid.astro" import { type CollectionEntry } from "astro:content" -import { type NavLink } from "@/utils/linking" interface Props { projects: CollectionEntry<"projects">[] } const { projects } = Astro.props - -const baseUrl: NavLink = "/projects" --- -
- { - projects.map( - ({ data: { title, description, tags, heroImage, heroImageAlt }, id }) => ( -
- -
- ), - ) - } -
+ diff --git a/src/components/projects/ProjectGrid.astro b/src/components/projects/ProjectGrid.astro new file mode 100644 index 0000000..fe8b2dc --- /dev/null +++ b/src/components/projects/ProjectGrid.astro @@ -0,0 +1,32 @@ +--- +import type { Project } from "@/types/types" +import type { NavLink } from "@/utils/linking" +import ProjectCard from "./ProjectCard.astro" + +interface Props { + projects: ReadonlyArray +} + +const { projects } = Astro.props + +const baseUrl: NavLink = "/projects" +--- + +
+ { + projects.map( + ({ data: { title, description, tags, heroImage, heroImageAlt }, id }) => ( +
+ +
+ ), + ) + } +
diff --git a/src/pages/en/index.astro b/src/pages/en/index.astro index b715435..b265d96 100644 --- a/src/pages/en/index.astro +++ b/src/pages/en/index.astro @@ -1,9 +1,9 @@ --- -import OnePager from "../../components/Greeting.astro" -import Layout from "../../layouts/Layout.astro" +import IndexPage from "@/components/landing/IndexPage.astro" +import Layout from "@/layouts/Layout.astro" import "@/styles/global.css" --- - + diff --git a/src/pages/index.astro b/src/pages/index.astro index 1cbe9b2..a688ee8 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,10 +1,9 @@ --- +import IndexPage from "@/components/landing/IndexPage.astro" import Layout from "@/layouts/Layout.astro" -import Greeting from "@/components/Greeting.astro" - -// https://slashpages.net/ +import "@/styles/global.css" --- - +