1
1
<script >
2
+ import { urlFor } from ' $lib/sanity/image.js'
3
+
2
4
import FaviconGithub from ' ./icons/favicon-github.svelte'
3
5
import Heading from ' ./heading.svelte'
6
+ import IconRSS from ' ./icons/icon-rss.svelte'
4
7
import MentionLink from ' ./mention-link.svelte'
5
8
import PortableText from ' ./portable-text.svelte'
6
9
@@ -17,7 +20,9 @@ export let project
17
20
<MentionLink href ={project .site }>Visit site</MentionLink >
18
21
{/if }
19
22
{#if project .post }
20
- <MentionLink href ={project .post }>Read blog post</MentionLink >
23
+ <MentionLink href ={project .post } logo ={IconRSS }
24
+ >Read post</MentionLink
25
+ >
21
26
{/if }
22
27
{#if project .repo }
23
28
<MentionLink href ={project .repo } logo ={FaviconGithub }
@@ -29,5 +34,32 @@ export let project
29
34
<PortableText value ={project .lede } />
30
35
</div >
31
36
</div >
32
- <!-- <div>Images</div> -->
37
+ {#if project .images ?.length > 0 }
38
+ <div class =" l:gap-8 flex justify-end gap-6" >
39
+ {#each project .images as image }
40
+ <figure class =" not-prose m-0 flex" >
41
+ <picture class =" transition-opacity duration-300" >
42
+ <source
43
+ srcset ={urlFor (image ).format (' webp' ).url ()}
44
+ type =" image/webp"
45
+ />
46
+ <img
47
+ class =" h-full w-full object-contain"
48
+ style:aspect-ratio ={image .metadata .dimensions
49
+ .aspectRatio }
50
+ style:max-height =" {Math .floor (
51
+ image .metadata .dimensions .height / 2 ,
52
+ )}px"
53
+ loading =" lazy"
54
+ decoding =" async"
55
+ alt =" "
56
+ sizes =" 100vw"
57
+ srcset ={urlFor (image ).format (' jpg' ).url ()}
58
+ src ={urlFor (image ).format (' jpg' ).url ()}
59
+ />
60
+ </picture >
61
+ </figure >
62
+ {/each }
63
+ </div >
64
+ {/if }
33
65
</article >
0 commit comments