@@ -13,7 +13,7 @@ export default function Organization({
17 applications = [],
17 applications = [],
18 spotlights = [],
18 spotlights = [],
@@ -21,7 +21,6 @@ export default function Organization({
21 <BasicPage
21 <BasicPage
22 section="Organizations"
22 section="Organizations"
23 post={post}
23 post={post}
25 markdown={markdown}
24 markdown={markdown}
26 search={search}
25 search={search}
27 index={index}
26 index={index}
@@ -59,6 +58,35 @@ export default function Organization({
61+ {groups.length > 0 && (
64+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
65+ {groups.map((group) => (
66+ <Link href={`/groups/${group.ship}/${group.slug}`}>
67+ <div className="flex flex-col space-y-4 cursor-pointer">
68+ {group?.tile?.startsWith("#") ? (
70+ className="rounded-xl"
72+ backgroundColor: group.tile,
80+ className="h-full w-full rounded-xl"
83+ <p className="text-center font-bold font-xl">{group.title}</p>
62 </BasicPage>
90 </BasicPage>
@@ -95,18 +123,18 @@ export async function getStaticProps({ params }) {
98− let group = null;
126+ const groups = post.ships
99− const groupHost = post?.group?.slice(0, post.group.indexOf("/"));
127+ .map((ship) => {
100− const groupName = post?.group?.slice(post.group.indexOf("/"));
128+ let groups = [];
103− fs.existsSync(path.join(process.cwd(), "content/groups", groupHost)) &&
129+ if (fs.existsSync(path.join(process.cwd(), "content/groups", ship))) {
104− fs.existsSync(
130+ groups = getAllPosts(["title", "tile", "slug"], `groups/${ship}`).map(
105− path.join(process.cwd(), "content/groups", groupHost, `${groupName}.md`)
131+ (e) => ({ ...e, ship })
108− group = getPostBySlug(groupName, ["title"], `groups/${groupHost}`);
110 let { index } = post?.extra || { index: null };
138 let { index } = post?.extra || { index: null };
112 if (index === undefined) {
140 if (index === undefined) {
@@ -115,7 +143,7 @@ export async function getStaticProps({ params }) {
116 const markdown = JSON.stringify(Markdown.parse({ post }));
144 const markdown = JSON.stringify(Markdown.parse({ post }));
118− props: { post, markdown, spotlights, applications, group, index },
146+ props: { post, markdown, spotlights, applications, groups, index },