✨ Latest projects on landing page, moved landing page components
All checks were successful
Build and deploy website / build (push) Successful in 34s
All checks were successful
Build and deploy website / build (push) Successful in 34s
This commit is contained in:
@ -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} />
|
||||
|
32
src/components/projects/ProjectGrid.astro
Normal file
32
src/components/projects/ProjectGrid.astro
Normal 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>
|
Reference in New Issue
Block a user