fixed queries?

This commit is contained in:
ChrQR 2024-04-27 21:24:58 +02:00
parent dc8baf8d18
commit ec0e91fcfa
3 changed files with 25 additions and 17 deletions

View File

@ -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
`

View File

@ -10,7 +10,7 @@
<p class="">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.
</p>
<img class="rounded-2xl xl:ml-4 md:w-auto md:h-52 md:ml-0 md:mt-4 sm:ml-0 sm:mt-4 sm:w-full" src={migImg} alt="crazy man"/>
<img class="rounded-2xl xl:ml-4 md:w-auto md:h-52 md:ml-4 md:mt-4 sm:ml-0 sm:mt-4 sm:w-full" src={migImg} alt="crazy man"/>
</div>
<p class="mb-4 ">I work in recruitment, and I specialise in building product teams for start ups and scale ups for a small recruitment agency called <a class="underline font-semibold" href="https://www.adveniopeople.com">Advenio People</a></p>
<img src={osImg} alt="A happy man and a beautiful woman both wearing facemasks." class="rounded-full w-1/2 h-auto m-auto">

View File

@ -1,5 +1,4 @@
<script>
export let data;
</script>
<p>{data.posts}</p>