refactor: separate image load code in entry into just server
All checks were successful
create archive with lfs / tag (push) Successful in 5s
All checks were successful
create archive with lfs / tag (push) Successful in 5s
This commit is contained in:
parent
0749c30db0
commit
6ee2862bf8
@ -6,8 +6,9 @@ excerpt = "photos from my trip to japan"
|
|||||||
+++
|
+++
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import images from './images.json'
|
|
||||||
import { CldImage } from 'svelte-cloudinary'
|
import { CldImage } from 'svelte-cloudinary'
|
||||||
|
|
||||||
|
export let data
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -26,8 +27,7 @@ fixed!!!! i also added a few images because im dumb and forgot
|
|||||||
*(you can click on an image to see original!)*
|
*(you can click on an image to see original!)*
|
||||||
|
|
||||||
<div class="grid gap-0.5 auto-rows-min md:grid-cols-4">
|
<div class="grid gap-0.5 auto-rows-min md:grid-cols-4">
|
||||||
{#each images as image}
|
{#each data.images as image}
|
||||||
{@const ogimage = `https://res.cloudinary.com/dgtwf7mar/image/upload/${image}`}
|
<a class="!animate-none" href={image.og}><CldImage width={480} height={480} src={image.id} class="w-full h-full object-cover [image-rendering:high-quality_!important]"/></a>
|
||||||
<a class="!animate-none" href={ogimage}><CldImage width={480} height={480} src={image} class="w-full h-full object-cover [image-rendering:high-quality_!important]"/></a>
|
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
12
src/routes/entries/japan-trip24/+page.server.ts
Normal file
12
src/routes/entries/japan-trip24/+page.server.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import images from './images.json'
|
||||||
|
|
||||||
|
export async function load({}) {
|
||||||
|
return {
|
||||||
|
images: images.map((id) => {
|
||||||
|
return {
|
||||||
|
og: `https://res.cloudinary.com/dgtwf7mar/image/upload/${id}`,
|
||||||
|
id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user