✨ 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:
parent
22cdc634f9
commit
e1c3ae7d87
7
src/components/landing/IndexPage.astro
Normal file
7
src/components/landing/IndexPage.astro
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
import Greeting from "./Greeting.astro"
|
||||
import LatestProjects from "./LatestProjects.astro"
|
||||
---
|
||||
|
||||
<Greeting />
|
||||
<LatestProjects />
|
10
src/components/landing/LatestProjects.astro
Normal file
10
src/components/landing/LatestProjects.astro
Normal 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} />
|
@ -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>
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user