@@ -22,6 +22,7 @@ import IndexCard from "../components/ecosystem/IndexCard";
22import fs from "fs";
22import fs from "fs";
23import path from "path";
23import path from "path";
24import Meta from "../components/Meta";
24import Meta from "../components/Meta";
25+import { matchEcosystemPost } from "../lib/lib";
26export default function Home({
27export default function Home({
@@ -316,85 +317,12 @@ export async function getStaticProps() {
319− // Pull all latest ecosystem information
320+ // Latest ecosystem report with matched post metadata
320− const ecosystem = getAllPosts(
321+ const ecosystem = matchEcosystemPost(getAllPosts(
321 ["date", "featured-1", "featured-2", "featured-3"],
322 ["date", "featured-1", "featured-2", "featured-3"],
322 "ecosystem/spotlight",
323 "ecosystem/spotlight",
326− const articles = getAllPosts(
327− ["title", "image", "date", "podcast", "slug"],
332− const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
333− const podcasts = getAllPosts(
334− ["title", "image", "date", "podcast", "slug"],
338− const organizations = getAllPosts(
339− ["title", "image", "slug"],
342− const applications = fs
343− .readdirSync(path.join(process.cwd(), "content/applications"), {
344− withFileTypes: true,
346− .filter((f) => f.isDirectory())
349− ["title", "bgColor", "image", "slug", "description"],
350− `applications/${dir.name}`
352− .map((e) => ({ ...e, ship: dir.name }))
357− const nameA = a.title.toLowerCase();
358− const nameB = b.title.toLowerCase();
359− return nameA < nameB ? -1 : 1;
363− .readdirSync(path.join(process.cwd(), "content/groups"), {
364− withFileTypes: true,
366− .filter((f) => f.isDirectory())
369− ["title", "tile", "slug", "description"],
370− `groups/${dir.name}`
372− .map((e) => ({ ...e, ship: dir.name }))
377− const nameA = a.title.toLowerCase();
378− const nameB = b.title.toLowerCase();
379− return nameA < nameB ? -1 : 1;
382− ["featured-1", "featured-2", "featured-3"].forEach((feat) => {
383− if (ecosystem?.[feat]) {
384− const matchedPost = [
385− ...articles.map((e) => ({ ...e, type: "Article" })),
386− ...applications.map((e) => ({ ...e, type: "Application" })),
387− ...organizations.map((e) => ({ ...e, type: "Organization" })),
388− ...podcasts.map((e) => ({ ...e, type: "Podcast" })),
389− ...marketplaces.map((e) => ({ ...e, type: "Marketplace" })),
390− ...groups.map((e) => ({ ...e, type: "Group" }))
391− ].filter((e) => e.title === ecosystem[feat].title)?.[0];
392− ecosystem[feat].image =
393− ecosystem[feat].image || matchedPost?.image || null;
394− ecosystem[feat].type = matchedPost?.type || "Podcast";
395− ecosystem[feat].matchedPost = matchedPost || null;
399 // Latest grants
327 // Latest grants
400 const basePath = path.join(process.cwd(), 'content/grants')
328 const basePath = path.join(process.cwd(), 'content/grants')