File tree Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Expand file tree Collapse file tree 3 files changed +22
-12
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Icon } from "astro-icon/components";
33import { isEmpty } from " lodash-es" ;
44import { marked } from " marked" ;
55
6+ import { Image } from " astro:assets" ;
67import Banner from " ../../../components/Banner.astro" ;
78import Layout from " ../../../layouts/Layout.astro" ;
89import type { Plugin } from " ./type" ;
5051 {
5152 !! plugin .images ?.length && (
5253 <div class = " banner-image" >
53- <img
54+ <Image
55+ inferSize
56+ layout = " constrained"
5457 class = " flex-shrink-0 bg-white"
5558 src = { ` https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${plugin .images [0 ].image } ` }
5659 alt = " "
@@ -170,7 +173,10 @@ try {
170173 href = { ` https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${image } ` }
171174 class = " "
172175 >
173- <img
176+ <Image
177+ inferSize
178+ alt = { " " }
179+ layout = " constrained"
174180 class = " border img-fluid"
175181 src = { ` https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${image } ` }
176182 />
Original file line number Diff line number Diff line change 11---
2- import { reverse , sortBy } from " lodash-es" ;
2+ import { Image } from " astro:assets" ;
3+ import { isNil , reverse , sortBy } from " lodash-es" ;
34import Banner from " ../../../components/Banner.astro" ;
5+ import Default from " ../../../images/plugins/default-screenshot.jpg" ;
46import Layout from " ../../../layouts/Layout.astro" ;
57import { PluginsFilters } from " ./PluginsFilters" ;
68import type { Plugin } from " ./type" ;
@@ -39,15 +41,17 @@ const pluginsData: Plugin[] | null = pluginsDataRequest.ok
3941 class = { ` category-${p .category } ${p .versions ? Object .keys (p .versions ).map ((v ) => ` version-${v } ` ) : " " } ` }
4042 >
4143 <a class = " card" href = { ` /desktop/plugins/${p .id } ` } >
42- <img
43- alt = " "
44- class = " card-img-top plugin-image"
45- src = {
46- p .images && p .images [0 ]
47- ? ` https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${p .images [0 ].image } `
48- : " /plugins/default-screenshot.jpg"
49- }
50- />
44+ { ! isNil (p .images ) && p .images [0 ] !== undefined ? (
45+ <Image
46+ inferSize
47+ alt = " "
48+ class = " card-img-top plugin-image"
49+ layout = " constrained"
50+ src = { ` https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${p .images [0 ].image } ` }
51+ />
52+ ) : (
53+ <Image alt = " " class = " card-img-top plugin-image" layout = " constrained" src = { Default } />
54+ )}
5155 <div >
5256 <small class = " plugin-category" >{ p .category } </small >
5357 </div >
You can’t perform that action at this time.
0 commit comments