Add dynamic photo's index on Location page
This commit is contained in:
@@ -143,7 +143,7 @@
|
||||
</section>
|
||||
|
||||
<section class="location-page__houses grid">
|
||||
{#each photos as { title, image: { id, title: alt }, slug, date_taken }}
|
||||
{#each photos as { title, image: { id, title: alt }, slug, date_taken }, index}
|
||||
<div class="house grid">
|
||||
<div class="house__info">
|
||||
<a href="/{params.country}/{params.location}/{slug}">
|
||||
@@ -163,7 +163,9 @@
|
||||
height={853}
|
||||
class="shadow-photo"
|
||||
/>
|
||||
<span class="house__index title-index">22</span>
|
||||
<span class="house__index title-index">
|
||||
{(totalPhotos - index < 10) ? '0' : ''}{totalPhotos - index}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user