@@ -13,6 +13,8 @@ import Header from "../../../components/Header";
13import Footer from "../../../components/Footer";
13import Footer from "../../../components/Footer";
14import Post from "../../../components/ecosystem/Post";
14import Post from "../../../components/ecosystem/Post";
15import { getAllPosts, getPostBySlug } from "../../../lib/lib";
15import { getAllPosts, getPostBySlug } from "../../../lib/lib";
17+import path from "path";
17export default function BasicPage({ post, markdown, search, index = false }) {
19export default function BasicPage({ post, markdown, search, index = false }) {
18 const router = useRouter();
20 const router = useRouter();
@@ -46,8 +48,47 @@ export async function getStaticProps({ params }) {
46 ["title", "slug", "date", "featured-1", "featured-2", "featured-3"],
48 ["title", "slug", "date", "featured-1", "featured-2", "featured-3"],
47 "ecosystem/spotlight"
49 "ecosystem/spotlight"
51+ const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
52+ const podcasts = getAllPosts(
53+ ["title", "image", "date", "podcast", "slug"],
57+ const organizations = getAllPosts(
58+ ["title", "image", "slug"],
61+ const applications = fs
62+ .readdirSync(path.join(process.cwd(), "content/applications"), {
65+ .filter((f) => f.isDirectory())
68+ ["title", "bgColor", "image", "slug", "description"],
69+ `applications/${dir.name}`
71+ .map((e) => ({ ...e, ship: dir.name }))
76+ const nameA = a.title.toLowerCase();
77+ const nameB = b.title.toLowerCase();
78+ return nameA < nameB ? -1 : 1;
49 ["featured-1", "featured-2", "featured-3"].forEach((feat) => {
81 ["featured-1", "featured-2", "featured-3"].forEach((feat) => {
50 if (post?.[feat]) {
82 if (post?.[feat]) {
83+ const matchedPost = [
84+ ...applications.map((e) => ({ ...e, type: "Application" })),
85+ ...organizations.map((e) => ({ ...e, type: "Organization" })),
86+ ...podcasts.map((e) => ({ ...e, type: "Podcast" })),
87+ ...marketplaces.map((e) => ({ ...e, type: "Marketplace" })),
88+ ].filter((e) => e.title === post[feat].title)?.[0];
89+ post[feat].image = post[feat]?.image || matchedPost?.image || null;
90+ post[feat].type = matchedPost?.type || "Podcast";
91+ post[feat].matchedPost = matchedPost || null;
51 post[feat].content = JSON.stringify(
92 post[feat].content = JSON.stringify(
52 Markdown.parse({
93 Markdown.parse({
53 post: { content: post[feat].content },
94 post: { content: post[feat].content },