Latest projects on landing page, moved landing page components
All checks were successful
Build and deploy website / build (push) Successful in 34s

This commit is contained in:
Martin Berg Alstad 2025-02-16 12:01:51 +01:00
parent 22cdc634f9
commit e1c3ae7d87
Signed by: martials
GPG Key ID: 706F53DD087A91DE
7 changed files with 57 additions and 29 deletions

View File

@ -0,0 +1,7 @@
---
import Greeting from "./Greeting.astro"
import LatestProjects from "./LatestProjects.astro"
---
<Greeting />
<LatestProjects />

View File

@ -0,0 +1,10 @@
---
import { getCollection } from "astro:content"
import ProjectGrid from "@/components/projects/ProjectGrid.astro"
const projects = await getCollection("projects")
---
<div class="divider"></div>
<ProjectGrid projects={projects} />

View File

@ -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"
---
<div class="flex flex-wrap justify-around">
{
projects.map(
({ data: { title, description, tags, heroImage, heroImageAlt }, id }) => (
<div class="my-5 px-2">
<ProjectCard
title={title}
linkTo={`${baseUrl}/${id}`}
description={description}
tags={tags}
image={heroImage}
imageAlt={heroImageAlt}
/>
</div>
),
)
}
</div>
<ProjectGrid projects={projects} />

View File

@ -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<Project>
}
const { projects } = Astro.props
const baseUrl: NavLink = "/projects"
---
<div class="flex flex-wrap justify-around">
{
projects.map(
({ data: { title, description, tags, heroImage, heroImageAlt }, id }) => (
<div class="my-5 px-2">
<ProjectCard
title={title}
linkTo={`${baseUrl}/${id}`}
description={description}
tags={tags}
image={heroImage}
imageAlt={heroImageAlt}
/>
</div>
),
)
}
</div>

View File

@ -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"
---
<Layout title="Welcome">
<OnePager />
<IndexPage />
</Layout>

View File

@ -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"
---
<Layout title="Velkommen">
<Greeting />
<IndexPage />
</Layout>