@@ -17,6 +17,8 @@ import TwoUp from "../components/TwoUp";
17import { getAllPosts, getAllEvents, generateRealtimeDate } from "../lib/lib";
17import { getAllPosts, getAllEvents, generateRealtimeDate } from "../lib/lib";
18import { eventKeys } from "../lib/constants";
18import { eventKeys } from "../lib/constants";
19import IndexCard from "../components/ecosystem/IndexCard";
19import IndexCard from "../components/ecosystem/IndexCard";
21+import path from "path";
21export default function Home({
23export default function Home({
@@ -264,20 +266,64 @@ export default function Home({
266export async function getStaticProps() {
268export async function getStaticProps() {
269+ // Latest blog posts
267 const posts = getAllPosts(
270 const posts = getAllPosts(
268 ["title", "slug", "date", "description", "extra"],
271 ["title", "slug", "date", "description", "extra"],
276+ // Pull all latest ecosystem information
273 const ecosystem = getAllPosts(
277 const ecosystem = getAllPosts(
274 ["featured-1", "featured-2", "featured-3"],
278 ["featured-1", "featured-2", "featured-3"],
275 "ecosystem/spotlight",
279 "ecosystem/spotlight",
279− const events = getAllEvents(eventKeys, "events");
283+ const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
284+ const podcasts = getAllPosts(
285+ ["title", "image", "date", "podcast", "slug"],
289+ const organizations = getAllPosts(
290+ ["title", "image", "slug"],
293+ const applications = fs
294+ .readdirSync(path.join(process.cwd(), "content/applications"), {
295+ withFileTypes: true,
297+ .filter((f) => f.isDirectory())
300+ ["title", "bgColor", "image", "slug", "description"],
301+ `applications/${dir.name}`
303+ .map((e) => ({ ...e, ship: dir.name }))
308+ const nameA = a.title.toLowerCase();
309+ const nameB = b.title.toLowerCase();
310+ return nameA < nameB ? -1 : 1;
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";
281 const grants = getAllPosts(["extra", "taxonomies"], "grants", "date");
327 const grants = getAllPosts(["extra", "taxonomies"], "grants", "date");
283 const grantNumbers = {
329 const grantNumbers = {
@@ -300,6 +346,8 @@ export async function getStaticProps() {
300 ).length,
346 ).length,
350+ const events = getAllEvents(eventKeys, "events");
303 const now = DateTime.now();
351 const now = DateTime.now();
305 const pastEvents = events.filter((event) => {
353 const pastEvents = events.filter((event) => {