on master help sign in
ecosystem logic and design polish
5252f42Gordon
components/ecosystem/BasicPage.js+1−1
@@ -45,7 +45,7 @@ export default function BasicPage({
45 <div className="flex items-center space-x-4">
45 <div className="flex items-center space-x-4">
46 <img src={post.image} className="w-36" />
46 <img src={post.image} className="w-36" />
47 <div className="flex flex-col pl-2">
47 <div className="flex flex-col pl-2">
48− <h1 className={classnames({ "text-3xl": section === "Podcast" }, { "text-3xl": section === "Article" })}>
48+ <h1 className="text-3xl">
49 {post.title}
49 {post.title}
50 </h1>
50 </h1>
51 <p>{section}</p>
51 <p>{section}</p>
components/ecosystem/EcosystemSidebar.js+8
@@ -30,6 +30,13 @@ export default function EcosystemSidebar() {
30 >
30 >
31 Spotlight
31 Spotlight
32 </ActiveLink>
32 </ActiveLink>
33+ <ActiveLink
34+ currentPath={currentPath}
35+ className="type-ui"
36+ href="/ecosystem?type=communities"
37+ >
38+ Communities
39+ </ActiveLink>
33 <ActiveLink
40 <ActiveLink
34 currentPath={currentPath}
41 currentPath={currentPath}
35 className="type-ui"
42 className="type-ui"
@@ -37,6 +44,7 @@ export default function EcosystemSidebar() {
37 >
44 >
38 Organizations
45 Organizations
39 </ActiveLink>
46 </ActiveLink>
47+
40 <ActiveLink
48 <ActiveLink
41 currentPath={currentPath}
49 currentPath={currentPath}
42 className="type-ui"
50 className="type-ui"
components/ecosystem/Post.js+9
@@ -74,6 +74,15 @@ export default function Post({ post }) {
74 </Link>
74 </Link>
75 )}
75 )}
76
76
77+ {post[feat].type === "Community" && (
78+ <Link href={href || "#"} passHref>
79+ <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
80+ More about {post[feat].title}
81+ </a>
82+ </Link>
83+ )}
84+
85+
77 {post[feat].type === "Marketplace" && (
86 {post[feat].type === "Marketplace" && (
78 <Link href={href || "#"} passHref>
87 <Link href={href || "#"} passHref>
79 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
88 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
content/communities/urbit-austin.md+2−2
@@ -1,7 +1,7 @@
1+++
1+++
2title = "Urbit Austin"
2title = "Urbit Austin"
3−description = "Urbit meetups in Austin"
3+description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-austin.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-austin.png"
5+++
5+++
6
6
7Curious about Urbit? Questions about Hoon syntax? Fed up with the current state of the internet? Join us to talk about the internet's future.
7Curious about Urbit? Questions about Hoon syntax? Fed up with the current state of the internet? Join us to talk about the internet's future.
content/communities/urbit-berlin.md+1−1
@@ -1,7 +1,7 @@
1+++
1+++
2title = "Urbit Berlin"
2title = "Urbit Berlin"
3description = ""
3description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-berlin.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-berlin.png"
5+++
5+++
6
6
7If you are sick of the current state of the web, of handing over your data and entire online presence to a handful of American corporations, of a web fueled with ads, then Urbit might be for you.
7If you are sick of the current state of the web, of handing over your data and entire online presence to a handful of American corporations, of a web fueled with ads, then Urbit might be for you.
content/communities/urbit-cph.md+2−2
@@ -1,7 +1,7 @@
1+++
1+++
2title = "Urbit København"
2title = "Urbit København"
3−description = "Join us in CPH"
3+description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-cph.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-cph.png"
5+++
5+++
6
6
7~norsyr-torryn/nordics
7~norsyr-torryn/nordics
content/communities/urbit-dc.md+2−2
@@ -1,7 +1,7 @@
1+++
1+++
2title = "DC Metro Urbit Meetup Group"
2title = "DC Metro Urbit Meetup Group"
3−description = "Urbit meetups in the DC area"
3+description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-dc.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-dc.png"
5+++
5+++
6
6
7This is a DC/Northern Virginia/Southern Maryland Urbit discussion group.
7This is a DC/Northern Virginia/Southern Maryland Urbit discussion group.
content/communities/urbit-ny.md+2−2
@@ -1,7 +1,7 @@
1+++
1+++
2title = "Urbit NY"
2title = "Urbit NY"
3−description = "Urbit meetups in New York"
3+description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-ny.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-ny.png"
5+++
5+++
6
6
7We love experimenting with Urbit & tinkering with Arvo, Hoon, & Nock
7We love experimenting with Urbit & tinkering with Arvo, Hoon, & Nock
content/communities/urbit-seattle.md+2−2
@@ -1,7 +1,7 @@
1+++
1+++
2title = "Urbit Seattle"
2title = "Urbit Seattle"
3−description = "Urbit meetups in Seattle"
3+description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-seattle.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-seattle.png"
5+++
5+++
6
6
7Urbit is a simple, durable computer that you own 100% and forever. In this group, we'll discuss ongoing project developments, technical details, and how to use Urbit. With occasional speakers that will present on various topics.
7Urbit is a simple, durable computer that you own 100% and forever. In this group, we'll discuss ongoing project developments, technical details, and how to use Urbit. With occasional speakers that will present on various topics.
content/communities/urbit-sf.md+2−2
@@ -1,7 +1,7 @@
1+++
1+++
2title = "Urbit SF"
2title = "Urbit SF"
3−description = "Urbit meetups in San Francisco"
3+description = ""
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-sf.png"
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-sf.png"
5+++
5+++
6
6
7Want to own and control the server side? Your digital identity, data and computation?
7Want to own and control the server side? Your digital identity, data and computation?
pages/communities/[slug].jsnew file+84
@@ -0,0 +1,84 @@
1+import BasicPage from "../../components/ecosystem/BasicPage";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
7+} from "@urbit/foundation-design-system";
8+import Link from "next/link";
9+
10+export default function Community({
11+ post,
12+ markdown,
13+ search,
14+ index,
15+ spotlights = [],
16+}) {
17+ return (
18+ <BasicPage
19+ section="Community"
20+ post={post}
21+ markdown={markdown}
22+ search={search}
23+ index={index}
24+ >
25+ {spotlights.length > 0 && (
26+ <p>
27+ Featured in{" "}
28+ {spotlights.map((e, i) => (
29+ <>
30+ {i ? ", " : ""}
31+ <Link href={`/ecosystem/spotlight/${e.slug}`}>{e.title}</Link>
32+ </>
33+ ))}
34+ </p>
35+ )}
36+ </BasicPage>
37+ );
38+}
39+
40+export async function getStaticProps({ params }) {
41+ const post = getPostBySlug(
42+ params.slug,
43+ ["title", "description", "slug", "image", "content"],
44+ "communities"
45+ );
46+
47+ const spotlights = getAllPosts(
48+ ["title", "slug", "featured-1", "featured-2", "featured-3"],
49+ "ecosystem/spotlight"
50+ ).filter(
51+ (e) =>
52+ e?.["featured-1"]?.title === post.title ||
53+ e?.["featured-2"]?.title === post.title ||
54+ e?.["featured-3"]?.title === post.title
55+ );
56+
57+ let { index } = post?.extra || { index: null };
58+
59+ if (index === undefined) {
60+ index = null;
61+ }
62+
63+ const markdown = JSON.stringify(Markdown.parse({ post }));
64+ return {
65+ props: { post, markdown, spotlights, index },
66+ };
67+}
68+
69+export async function getStaticPaths() {
70+ const posts = getPostSlugs("communities");
71+
72+ const slugs = posts.map((e) => e.slice(0, -3));
73+
74+ return {
75+ paths: slugs.map((post) => {
76+ return {
77+ params: {
78+ slug: post,
79+ },
80+ };
81+ }),
82+ fallback: false,
83+ };
84+}
pages/ecosystem/index.js+80−24
@@ -32,7 +32,8 @@ export default function Ecosystem({
32 marketplaces,
32 marketplaces,
33 organizations,
33 organizations,
34 podcasts,
34 podcasts,
35− articles
35+ articles,
36+ communities
36}) {
37}) {
37 const router = useRouter();
38 const router = useRouter();
38
39
@@ -53,6 +54,9 @@ export default function Ecosystem({
53 case "applications":
54 case "applications":
54 title = "Applications • Ecosystem";
55 title = "Applications • Ecosystem";
55 break;
56 break;
57+ case "communities":
58+ title = "Communities • Ecosystem";
59+ break;
56 case "applications":
60 case "applications":
57 title = "Groups • Ecosystem";
61 title = "Groups • Ecosystem";
58 break;
62 break;
@@ -124,10 +128,9 @@ export default function Ecosystem({
124 {/* Ecosystem type layouts */}
128 {/* Ecosystem type layouts */}
125 <div
129 <div
126 className={classnames("grid gap-12 w-full", {
130 className={classnames("grid gap-12 w-full", {
127− "grid-cols-2 md:grid-cols-3": type == "organizations" || type == "marketplaces",
128 "grid-cols-1": type === "podcasts" || type === "articles",
131 "grid-cols-1": type === "podcasts" || type === "articles",
129 "grid-cols-1 md:grid-cols-1 lg:grid-cols-1 xl:grid-cols-2":
132 "grid-cols-1 md:grid-cols-1 lg:grid-cols-1 xl:grid-cols-2":
130− type === "applications" || type === "groups",
133+ type === "applications" || type === "groups" || type === "communities" || type === "organizations" || type === "marketplaces",
131 hidden: spotlight,
134 hidden: spotlight,
132 })}
135 })}
133 >
136 >
@@ -138,6 +141,9 @@ export default function Ecosystem({
138 {type === "applications" &&
141 {type === "applications" &&
139 <Applications dir={applications} />
142 <Applications dir={applications} />
140 }
143 }
144+ {type === "communities" &&
145+ <Communities dir={communities} />
146+ }
141 {type === "groups" &&
147 {type === "groups" &&
142 <Groups dir={groups} />
148 <Groups dir={groups} />
143 }
149 }
@@ -161,16 +167,6 @@ export default function Ecosystem({
161 );
167 );
162}
168}
163
169
164−const Organizations = ({ dir }) => {
165− return dir.map((org) => (
166− <Link href={`/organizations/${org.slug}`}>
167− <div className="flex flex-col space-y-4 items-center cursor-pointer hover:opacity-90">
168− <img className="w-36 rounded-xl" src={org.image} />
169− <p className="text-center font-bold">{org.title}</p>
170− </div>
171− </Link>
172− ))
173−}
174
170
175const Applications = ({ dir }) => {
171const Applications = ({ dir }) => {
176 return dir.map((app) => (
172 return dir.map((app) => (
@@ -230,16 +226,6 @@ const Groups = ({ dir }) => {
230 ))
226 ))
231}
227}
232
228
233−const Marketplaces = ({ dir }) => {
234− return dir.map((market) => (
235− <Link href={`/marketplaces/${market.slug}`}>
236− <div className="flex flex-col space-y-4 justify-center items-center cursor-pointer hover:opacity-90">
237− <img className="w-36 rounded-xl" src={market.image} />
238− <p className="text-center font-bold">{market.title}</p>
239− </div>
240− </Link>
241− ))
242−}
243
229
244const Podcasts = ({ dir }) => {
230const Podcasts = ({ dir }) => {
245 return dir.map((pod) => (
231 return dir.map((pod) => (
@@ -279,6 +265,74 @@ const Articles = ({ dir }) => {
279 ))
265 ))
280}
266}
281
267
268+const Communities = ({ dir }) => {
269+ return dir.map((community) => (
270+ <Link href={`/communities/${community.slug}`}>
271+ <div className="flex space-x-4 items-center cursor-pointer hover:opacity-90">
272+ <div className="h-36 w-36 rounded-xl items-center justify-center shrink-0 overflow-hidden">
273+ <img
274+ className="items-center h-36 w-36"
275+ src={community.image}
276+ />
277+ </div>
278+ <div className="">
279+ <p className="text-left font-bold">{community.title}</p>
280+ <p className="text-left text-wall-400 font-light">
281+ {community.description}
282+ </p>
283+ </div>
284+ </div>
285+ </Link>
286+ ))
287+}
288+
289+
290+const Marketplaces = ({ dir }) => {
291+ return dir.map((market) => (
292+ <Link href={`/marketplaces/${market.slug}`}>
293+ <div className="flex space-x-4 items-center cursor-pointer hover:opacity-90">
294+ <div className="h-36 w-36 rounded-xl items-center justify-center shrink-0 overflow-hidden">
295+ <img
296+ className="items-center h-36 w-36"
297+ src={market.image}
298+ />
299+ </div>
300+ <div className="">
301+ <p className="text-left font-bold">{market.title}</p>
302+ <p className="text-left text-wall-400 font-light">
303+ {market.description}
304+ </p>
305+ </div>
306+ </div>
307+ </Link>
308+ ))
309+}
310+
311+const Organizations = ({ dir }) => {
312+ return dir.map((org) => (
313+ <Link href={`/organizations/${org.slug}`}>
314+ <div className="flex space-x-4 items-center cursor-pointer hover:opacity-90">
315+ <div className="h-36 w-36 rounded-xl items-center justify-center shrink-0 overflow-hidden">
316+ <img
317+ className="items-center h-36 w-36"
318+ src={org.image}
319+ />
320+ </div>
321+ <div className="">
322+ <p className="text-left font-bold">{org.title}</p>
323+ <p className="text-left text-wall-400 font-light">
324+ {org.description}
325+ </p>
326+ </div>
327+ </div>
328+ </Link>
329+ ))
330+}
331+
332+
333+
334+
335+
282
336
283export async function getStaticProps() {
337export async function getStaticProps() {
284 const posts = getAllPosts(
338 const posts = getAllPosts(
@@ -292,6 +346,7 @@ export async function getStaticProps() {
292 "date"
346 "date"
293 )[0]);
347 )[0]);
294 const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
348 const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
349+ const communities = getAllPosts(["title", "image", "slug", "description"], "communities");
295 const podcasts = getAllPosts(
350 const podcasts = getAllPosts(
296 ["title", "image", "date", "podcast", "slug"],
351 ["title", "image", "date", "podcast", "slug"],
297 "podcasts",
352 "podcasts",
@@ -354,7 +409,8 @@ export async function getStaticProps() {
354 marketplaces,
409 marketplaces,
355 podcasts,
410 podcasts,
356 organizations,
411 organizations,
357− articles
412+ articles,
413+ communities
358 },
414 },
359 };
415 };
360}
416}