@@ -0,0 +1,132 @@
1+// Single page per organisation
2+// Needs to have *associated ships* by which it polls content/applications for applications it "owns"
3+// Needs to look for its title in ecosystem/spotlight
4+import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
5+import BasicPage from "../../components/ecosystem/BasicPage";
6+import { Markdown } from "foundation-design-system";
7+import Link from "next/link";
9+import path from "path";
11+export default function Organization({
22+ section="Organizations"
29+ {spotlights.length > 0 && (
32+ {spotlights.map((e, i) => (
35+ <Link href={`/ecosystem/spotlight/${e.slug}`}>{e.title}</Link>
40+ {applications.length > 0 && (
42+ <h3>Applications</h3>
43+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
44+ {applications.map((app) => (
45+ <Link href={`/applications/${app.ship}/${app.slug}`}>
46+ <div className="flex flex-col space-y-4 cursor-pointer">
48+ className="overflow-hidden rounded-xl"
49+ style={{ backgroundColor: app.bgColor || "rgba(0,0,0,0)" }}
52+ <img src={app.image} className="h-full w-full" />
55+ <p className="text-center font-bold font-xl">{app.title}</p>
66+export async function getStaticProps({ params }) {
67+ const post = getPostBySlug(
69+ ["title", "slug", "URL", "image", "ships", "group", "content"],
73+ const spotlights = getAllPosts(
74+ ["title", "slug", "featured"],
75+ "ecosystem/spotlight"
76+ ).filter((e) => e.featured.includes(post.title));
78+ const applications = post.ships
82+ fs.existsSync(path.join(process.cwd(), "content/applications", ship))
85+ ["title", "image", "bgColor", "slug"],
86+ `applications/${ship}`
87+ ).map((e) => ({ ...e, ship }));
94+ const groupHost = post?.group?.slice(0, post.group.indexOf("/"));
95+ const groupName = post?.group?.slice(post.group.indexOf("/"));
98+ fs.existsSync(path.join(process.cwd(), "content/groups", groupHost)) &&
100+ path.join(process.cwd(), "content/groups", groupHost, `${groupName}.md`)
103+ group = getPostBySlug(groupName, ["title"], `groups/${groupHost}`);
105+ let { index } = post?.extra || { index: null };
107+ if (index === undefined) {
111+ const markdown = JSON.stringify(Markdown.parse({ post }));
113+ props: { post, markdown, spotlights, applications, group, index },
117+export async function getStaticPaths() {
118+ const posts = getPostSlugs("organizations");
120+ const slugs = posts.map((e) => e.slice(0, -3));
123+ paths: slugs.map((post) => {