From f6c05b8a0c284297557a37033332957dcbda52d3 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Fri, 23 Aug 2024 21:01:26 -0500 Subject: [PATCH] change work to projects --- src/components/Nav.astro | 2 +- src/components/PortfolioPreview.astro | 4 ++-- src/content/config.ts | 2 +- src/content/{work => projects}/bloom-box.md | 0 src/content/{work => projects}/duvet-genius.md | 0 src/content/{work => projects}/h20.md | 0 src/content/{work => projects}/markdown-mystery-tour.md | 0 src/pages/index.astro | 8 ++++---- src/pages/{work.astro => projects.astro} | 6 +++--- src/pages/{work => projects}/[...slug].astro | 8 ++++---- 10 files changed, 15 insertions(+), 15 deletions(-) rename src/content/{work => projects}/bloom-box.md (100%) rename src/content/{work => projects}/duvet-genius.md (100%) rename src/content/{work => projects}/h20.md (100%) rename src/content/{work => projects}/markdown-mystery-tour.md (100%) rename src/pages/{work.astro => projects.astro} (88%) rename src/pages/{work => projects}/[...slug].astro (93%) diff --git a/src/components/Nav.astro b/src/components/Nav.astro index 46e5a5d..fd82199 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -5,7 +5,7 @@ import type { iconPaths } from './IconPaths'; const textLinks: { label: string; href: string }[] = [ { label: 'Home', href: '/' }, - { label: 'Work', href: '/work/' }, + { label: 'Projects', href: '/projects/' }, { label: 'About', href: '/about/' }, ]; diff --git a/src/components/PortfolioPreview.astro b/src/components/PortfolioPreview.astro index dbeac40..463a8ee 100644 --- a/src/components/PortfolioPreview.astro +++ b/src/components/PortfolioPreview.astro @@ -2,13 +2,13 @@ import type { CollectionEntry } from 'astro:content'; interface Props { - project: CollectionEntry<'work'>; + project: CollectionEntry<'projects'>; } const { data, slug } = Astro.props.project; --- - + {data.title} {data.img_alt diff --git a/src/content/config.ts b/src/content/config.ts index 06c6bab..3d4f6f9 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,7 +1,7 @@ import { defineCollection, z } from 'astro:content'; export const collections = { - work: defineCollection({ + projects: defineCollection({ type: 'content', schema: z.object({ title: z.string(), diff --git a/src/content/work/bloom-box.md b/src/content/projects/bloom-box.md similarity index 100% rename from src/content/work/bloom-box.md rename to src/content/projects/bloom-box.md diff --git a/src/content/work/duvet-genius.md b/src/content/projects/duvet-genius.md similarity index 100% rename from src/content/work/duvet-genius.md rename to src/content/projects/duvet-genius.md diff --git a/src/content/work/h20.md b/src/content/projects/h20.md similarity index 100% rename from src/content/work/h20.md rename to src/content/projects/h20.md diff --git a/src/content/work/markdown-mystery-tour.md b/src/content/projects/markdown-mystery-tour.md similarity index 100% rename from src/content/work/markdown-mystery-tour.md rename to src/content/projects/markdown-mystery-tour.md diff --git a/src/pages/index.astro b/src/pages/index.astro index 42bb6d1..266f330 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -13,7 +13,7 @@ import PortfolioPreview from '../components/PortfolioPreview.astro'; import ContactCTA from '../components/ContactCTA.astro'; import Skills from '../components/Skills.astro'; -const projects = (await getCollection('work')) +const projects = (await getCollection('projects')) .sort((a, b) => b.data.publishDate.valueOf() - a.data.publishDate.valueOf()) .slice(0, 4); --- @@ -48,8 +48,8 @@ const projects = (await getCollection('work'))
-

Selected Work

-

Take a look below at some of my featured work from the past few years.

+

Selected Projects

+

Take a look below at some of my featured projects from the past few years.

- + View All diff --git a/src/pages/work.astro b/src/pages/projects.astro similarity index 88% rename from src/pages/work.astro rename to src/pages/projects.astro index a619f39..b402b33 100644 --- a/src/pages/work.astro +++ b/src/pages/projects.astro @@ -8,19 +8,19 @@ import PortfolioPreview from '../components/PortfolioPreview.astro'; import Hero from '../components/Hero.astro'; import Grid from '../components/Grid.astro'; -const projects = (await getCollection('work')).sort( +const projects = (await getCollection('projects')).sort( (a, b) => b.data.publishDate.valueOf() - a.data.publishDate.valueOf(), ); ---
diff --git a/src/pages/work/[...slug].astro b/src/pages/projects/[...slug].astro similarity index 93% rename from src/pages/work/[...slug].astro rename to src/pages/projects/[...slug].astro index c7c28c1..3b40cc9 100644 --- a/src/pages/work/[...slug].astro +++ b/src/pages/projects/[...slug].astro @@ -9,12 +9,12 @@ import Icon from '../../components/Icon.astro'; import Pill from '../../components/Pill.astro'; interface Props { - entry: CollectionEntry<'work'>; + entry: CollectionEntry<'projects'>; } export async function getStaticPaths() { - const work = await getCollection('work'); - return work.map((entry) => ({ + const projects = await getCollection('projects'); + return projects.map((entry) => ({ params: { slug: entry.slug }, props: { entry }, })); @@ -29,7 +29,7 @@ const { Content } = await entry.render();