11---
22import { Image } from " astro:assets" ;
3+ import { Icon } from " astro-icon/components" ;
34import { isNil , reverse , sortBy } from " lodash-es" ;
45import Banner from " ../../../components/Banner.astro" ;
56import Default from " ../../../images/plugins/default-screenshot.jpg" ;
@@ -8,18 +9,39 @@ import { PluginsFilters } from "../../../components/plugins/PluginsFilters";
89import type { Plugin } from " ../../../type" ;
910import { pluginElementId } from " ../../../components/plugins/utils" ;
1011
11- const pluginsDataRequest = await fetch (
12- " https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/plugins.json" ,
13- );
12+ const pluginsDataUrl = " https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/plugins.json" ;
13+ let pluginsData: Plugin [] | null = null ;
1414
15- const pluginsData: Plugin [] | null = pluginsDataRequest .ok
16- ? reverse (sortBy ((await pluginsDataRequest .json ()).plugins as Plugin [], (p ) => new Date (p .last_update )))
17- : null ;
15+ try {
16+ const pluginsDataRequest = await fetch (pluginsDataUrl );
17+
18+ if (pluginsDataRequest .ok ) {
19+ pluginsData = reverse (
20+ sortBy ((await pluginsDataRequest .json ()).plugins as Plugin [], (p ) => new Date (p .last_update )),
21+ );
22+ }
23+ } catch (error ) {
24+ console .error (" Plugins data could not be loaded:" , error );
25+ }
1826---
1927
2028<Layout pageId =" desktop-plugins" >
2129 <Banner >
22- <h1 >Gephi plugins</h1 >
30+ <div class =" banner-contents" >
31+ <div class =" banner-texts" >
32+ <div >
33+ <h1 class =" gephi-font" >Gephi plugins</h1 >
34+ </div >
35+
36+ <p class =" fs-3" >Extend Gephi with <strong >community-developed</strong > plugins, or create your own.</p >
37+
38+ <div >
39+ <a href =" https://docs.gephi.org/desktop/Plugins/" class =" btn btn-white fs-4 fw-bold" >
40+ <Icon name =" ph:arrow-square-out-bold" /> Read the doc
41+ </a >
42+ </div >
43+ </div >
44+ </div >
2345 </Banner >
2446
2547 <main class =" plugins-main" >
@@ -42,11 +64,11 @@ const pluginsData: Plugin[] | null = pluginsDataRequest.ok
4264 >
4365 <a class = " card" href = { ` /desktop/plugins/${p .id } ` } >
4466 { ! isNil (p .images ) && p .images [0 ] !== undefined ? (
45- <Image
46- inferSize
67+ <img
4768 alt = " "
4869 class = " card-img-top plugin-image"
49- layout = " constrained"
70+ loading = " lazy"
71+ decoding = " async"
5072 src = { ` https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${p .images [0 ].image } ` }
5173 />
5274 ) : (
0 commit comments