Add link to photo on Homepage collage
This commit is contained in:
@@ -40,8 +40,12 @@
|
||||
|
||||
<section class="homepage__photos">
|
||||
<div class="homepage__collage">
|
||||
{#each photos as { image: { id, title } }}
|
||||
<PhotoCard id={id} alt={title} />
|
||||
{#each photos as { slug, location: { slug: locationSlug, country }, image: { id, title } }}
|
||||
<PhotoCard
|
||||
id={id}
|
||||
alt={title}
|
||||
url="/{country.slug}/{locationSlug}/{slug}"
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
@@ -96,6 +100,11 @@
|
||||
const res = await fetchAPI(`
|
||||
query {
|
||||
photo (limit: 11, sort: ["-date_created"]) {
|
||||
slug
|
||||
location {
|
||||
slug
|
||||
country { slug }
|
||||
}
|
||||
image {
|
||||
id
|
||||
title
|
||||
|
||||
Reference in New Issue
Block a user