on master help sign in
Merge branch 'mp/ecosystem' of https://github.com/urbit/urbit.org into mp/ecosystem
25b5d51Gordon
components/ecosystem/BasicPage.js−11
@@ -17,7 +17,6 @@ import Footer from "../Footer";
17export default function BasicPage({
17export default function BasicPage({
18 section,
18 section,
19 post,
19 post,
20− group,
21 markdown,
20 markdown,
22 search,
21 search,
23 children,
22 children,
@@ -75,16 +74,6 @@ export default function BasicPage({
75 </a>
74 </a>
76 </div>
75 </div>
77 )}
76 )}
78− {(group || post?.group) && (
79− <div className="flex flex-col">
80− <p className="font-bold text-wall-400">Group</p>
81− <Link href={`/groups/${post.group}`} passHref>
82− <a className="text-green-400 text-sm font-semibold font-mono">
83− {group?.title || post.group}
84− </a>
85− </Link>
86− </div>
87− )}
88 </div>
77 </div>
89 {post?.URL && section === "Podcasts" && (
78 {post?.URL && section === "Podcasts" && (
90 <div className="button-lg bg-green-400 text-white cursor-pointer flex space-x-2">
79 <div className="button-lg bg-green-400 text-white cursor-pointer flex space-x-2">
pages/blog/[slug].js−3
@@ -66,9 +66,6 @@ export default function Post({
66 <Section short narrow className="markdown">
66 <Section short narrow className="markdown">
67 <Markdown.render content={JSON.parse(markdown)} />
67 <Markdown.render content={JSON.parse(markdown)} />
68 </Section>
68 </Section>
69− <Section narrow>
70− <Contact />
71− </Section>
72 <Section wide className="flex">
69 <Section wide className="flex">
73 <TwoUp>
70 <TwoUp>
74 {nextPost ? (
71 {nextPost ? (
pages/events/[slug].js−3
@@ -122,9 +122,6 @@ export default function Event({
122 <Section short narrow className="markdown">
122 <Section short narrow className="markdown">
123 <Markdown.render content={JSON.parse(markdown)} />
123 <Markdown.render content={JSON.parse(markdown)} />
124 </Section>
124 </Section>
125− <Section narrow>
126− <Contact />
127− </Section>
128 <Section wide className="flex">
125 <Section wide className="flex">
129 <TwoUp>
126 <TwoUp>
130 {previousEvent ? (
127 {previousEvent ? (
pages/index.js−7
@@ -252,13 +252,6 @@ export default function Home({
252 </a>
252 </a>
253 </Link>
253 </Link>
254 </Section>
254 </Section>
255−
256− {
257− // Newsletter and social media
258− }
259− <Section narrow>
260− <Contact emphasize />
261− </Section>
262 </SingleColumn>
255 </SingleColumn>
263 <Footer />
256 <Footer />
264 </Container>
257 </Container>
pages/organizations/[slug].js+43−15
@@ -13,7 +13,7 @@ export default function Organization({
13 markdown,
13 markdown,
14 search,
14 search,
15 index,
15 index,
16− group,
16+ groups,
17 applications = [],
17 applications = [],
18 spotlights = [],
18 spotlights = [],
19}) {
19}) {
@@ -21,7 +21,6 @@ export default function Organization({
21 <BasicPage
21 <BasicPage
22 section="Organizations"
22 section="Organizations"
23 post={post}
23 post={post}
24− group={group}
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({
59 </div>
58 </div>
60 </>
59 </>
61 )}
60 )}
61+ {groups.length > 0 && (
62+ <>
63+ <h3>Groups</h3>
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("#") ? (
69+ <div
70+ className="rounded-xl"
71+ style={{
72+ backgroundColor: group.tile,
73+ height: 164,
74+ width: 164,
75+ }}
76+ />
77+ ) : (
78+ <img
79+ src={group.tile}
80+ className="h-full w-full rounded-xl"
81+ />
82+ )}
83+ <p className="text-center font-bold font-xl">{group.title}</p>
84+ </div>
85+ </Link>
86+ ))}
87+ </div>
88+ </>
89+ )}
62 </BasicPage>
90 </BasicPage>
63 );
91 );
64}
92}
@@ -95,18 +123,18 @@ export async function getStaticProps({ params }) {
95 })
123 })
96 .flat();
124 .flat();
97
125
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 = [];
101− if (
102− post.group &&
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 })
106− )
132+ );
107− ) {
108− group = getPostBySlug(groupName, ["title"], `groups/${groupHost}`);
109− }
133+ }
134+ return groups;
135+ })
136+ .flat();
137+
110 let { index } = post?.extra || { index: null };
138 let { index } = post?.extra || { index: null };
111
139
112 if (index === undefined) {
140 if (index === undefined) {
@@ -115,7 +143,7 @@ export async function getStaticProps({ params }) {
115
143
116 const markdown = JSON.stringify(Markdown.parse({ post }));
144 const markdown = JSON.stringify(Markdown.parse({ post }));
117 return {
145 return {
118− props: { post, markdown, spotlights, applications, group, index },
146+ props: { post, markdown, spotlights, applications, groups, index },
119 };
147 };
120}
148}
121
149
pages/updates/[slug].js+1−3
@@ -57,9 +57,7 @@ export default function Post({ post, markdown, search }) {
57 <Section narrow className="markdown">
57 <Section narrow className="markdown">
58 <Markdown.render content={JSON.parse(markdown)} />
58 <Markdown.render content={JSON.parse(markdown)} />
59 </Section>
59 </Section>
60− <Section narrow>
60+ <Section narrow>/></Section>
61− <Contact />
62− </Section>
63 <Section wide className="flex">
61 <Section wide className="flex">
64 {
62 {
65 // {previousPost === null ? (
63 // {previousPost === null ? (