From ec0e91fcfac09eb77416a773c196298fd13a410d Mon Sep 17 00:00:00 2001 From: ChrQR Date: Sat, 27 Apr 2024 21:24:58 +0200 Subject: [PATCH] fixed queries? --- src/lib/queries.js | 39 +++++++++++++++++++------------ src/routes/about/+page.svelte | 2 +- src/routes/learnings/+page.svelte | 1 - 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/lib/queries.js b/src/lib/queries.js index f3d219d..9573809 100644 --- a/src/lib/queries.js +++ b/src/lib/queries.js @@ -3,17 +3,25 @@ * As your schema evolves, this pattern will be useful to keep your data in sync across all surfaces. */ export function getPostsQuery(extraFilter) { - return /* groq */ `*[ - _type == "post" && - publishedAt < now() - ${extraFilter ? `&& ${extraFilter}` : ''} - ] | order(publishedAt desc) { - title, - slug, - coverImage, - _createdAt, - _updatedAt, - body, + return `*[_type == "project"] { + _id, + _type, + _createdAt, + _updatedAt, + title, + slug, + coverImage { + ..., + asset-> + }, + duration { + start, + end + }, + client, + site, + tags[], + body }` } @@ -24,10 +32,11 @@ export function getPostsQuery(extraFilter) { * In this case, we're defining that, to render an author card, we need their name, slug & image. */ export const POST_CARD_FRAGMENT = ` - title, - slug, - coverImage, + _id, + _type, _createdAt, _updatedAt, - body, + title, + slug, + coverImage ` \ No newline at end of file diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 55af183..dc6d894 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -10,7 +10,7 @@

I live in Copenhagen with my partner and children near the water. We love going on expeditions around the city in our cargo bike, or on my electrical skateboard. When we're not outside I spend a lot of time fiddling around with my homelab, and development projects. You can read more about my projects and homelab under the homelab and portfolio nav.

- crazy man + crazy man

I work in recruitment, and I specialise in building product teams for start ups and scale ups for a small recruitment agency called Advenio People

A happy man and a beautiful woman both wearing facemasks. diff --git a/src/routes/learnings/+page.svelte b/src/routes/learnings/+page.svelte index c0bad22..3dca8fd 100644 --- a/src/routes/learnings/+page.svelte +++ b/src/routes/learnings/+page.svelte @@ -1,5 +1,4 @@

{data.posts}

\ No newline at end of file