@@ -17,6 +17,8 @@ import TwoUp from "../components/TwoUp";
1717import { getAllPosts, getAllEvents, generateRealtimeDate } from "../lib/lib";
1818import { eventKeys } from "../lib/constants";
1919import IndexCard from "../components/ecosystem/IndexCard";
20+import fs from "fs";
21+import path from "path";
2022
2123export default function Home({
2224 posts,
@@ -264,20 +266,64 @@ export default function Home({
264266}
265267
266268export async function getStaticProps() {
269+ // Latest blog posts
267270 const posts = getAllPosts(
268271 ["title", "slug", "date", "description", "extra"],
269272 "blog",
270273 "date"
271274 );
272275
276+ // Pull all latest ecosystem information
273277 const ecosystem = getAllPosts(
274278 ["featured-1", "featured-2", "featured-3"],
275279 "ecosystem/spotlight",
276280 "date"
277281 )[0];
278282
279− const events = getAllEvents(eventKeys, "events");
283+ const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
284+ const podcasts = getAllPosts(
285+ ["title", "image", "date", "podcast", "slug"],
286+ "podcasts",
287+ "date"
288+ );
289+ const organizations = getAllPosts(
290+ ["title", "image", "slug"],
291+ "organizations"
292+ );
293+ const applications = fs
294+ .readdirSync(path.join(process.cwd(), "content/applications"), {
295+ withFileTypes: true,
296+ })
297+ .filter((f) => f.isDirectory())
298+ .map((dir) =>
299+ getAllPosts(
300+ ["title", "bgColor", "image", "slug", "description"],
301+ `applications/${dir.name}`
302+ )
303+ .map((e) => ({ ...e, ship: dir.name }))
304+ .flat()
305+ )
306+ .flat()
307+ .sort((a, b) => {
308+ const nameA = a.title.toLowerCase();
309+ const nameB = b.title.toLowerCase();
310+ return nameA < nameB ? -1 : 1;
311+ });
280312
313+ ["featured-1", "featured-2", "featured-3"].forEach((feat) => {
314+ if (ecosystem?.[feat]) {
315+ const matchedPost = [
316+ ...applications.map((e) => ({ ...e, type: "Application" })),
317+ ...organizations.map((e) => ({ ...e, type: "Organization" })),
318+ ...podcasts.map((e) => ({ ...e, type: "Podcast" })),
319+ ...marketplaces.map((e) => ({ ...e, type: "Marketplace" })),
320+ ].filter((e) => e.title === ecosystem[feat].title)?.[0];
321+ ecosystem[feat].image = ecosystem[feat].image || matchedPost?.image;
322+ ecosystem[feat].type = matchedPost?.type || "Podcast";
323+ }
324+ });
325+
326+ // Latest grants
281327 const grants = getAllPosts(["extra", "taxonomies"], "grants", "date");
282328
283329 const grantNumbers = {
@@ -300,6 +346,8 @@ export async function getStaticProps() {
300346 ).length,
301347 };
302348
349+ // Latest events
350+ const events = getAllEvents(eventKeys, "events");
303351 const now = DateTime.now();
304352
305353 const pastEvents = events.filter((event) => {