on master help sign in
ecosystem logic and design polish
commit5252f428b42da3311bb0452a171bbd40eadbfec2 authorGordon <gordon@hey.com> dateWed 4 Jan 2023, 14:57 (4 years ago) parent39813c0
12 files changed+195−38
components/ecosystem/BasicPage.js+1−1 components/ecosystem/EcosystemSidebar.js+8 components/ecosystem/Post.js+9 content/communities/urbit-austin.md+2−2 content/communities/urbit-berlin.md+1−1 content/communities/urbit-cph.md+2−2 content/communities/urbit-dc.md+2−2 content/communities/urbit-ny.md+2−2 content/communities/urbit-seattle.md+2−2 content/communities/urbit-sf.md+2−2 pages/communities/[slug].js+84 pages/ecosystem/index.js+80−24
components/ecosystem/BasicPage.js+1−1
@@ -45,7 +45,7 @@ export default function BasicPage({
4545 <div className="flex items-center space-x-4">
4646 <img src={post.image} className="w-36" />
4747 <div className="flex flex-col pl-2">
48− <h1 className={classnames({ "text-3xl": section === "Podcast" }, { "text-3xl": section === "Article" })}>
48+ <h1 className="text-3xl">
4949 {post.title}
5050 </h1>
5151 <p>{section}</p>
components/ecosystem/EcosystemSidebar.js+8
@@ -30,6 +30,13 @@ export default function EcosystemSidebar() {
3030 >
3131 Spotlight
3232 </ActiveLink>
33+ <ActiveLink
34+ currentPath={currentPath}
35+ className="type-ui"
36+ href="/ecosystem?type=communities"
37+ >
38+ Communities
39+ </ActiveLink>
3340 <ActiveLink
3441 currentPath={currentPath}
3542 className="type-ui"
@@ -37,6 +44,7 @@ export default function EcosystemSidebar() {
3744 >
3845 Organizations
3946 </ActiveLink>
47+
4048 <ActiveLink
4149 currentPath={currentPath}
4250 className="type-ui"
components/ecosystem/Post.js+9
@@ -74,6 +74,15 @@ export default function Post({ post }) {
7474 </Link>
7575 )}
7676
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+
7786 {post[feat].type === "Marketplace" && (
7887 <Link href={href || "#"} passHref>
7988 <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 @@
11+++
22title = "Urbit Austin"
3−description = "Urbit meetups in Austin"
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-austin.png"
3+description = ""
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-austin.png"
55+++
66
77Curious 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 @@
11+++
22title = "Urbit Berlin"
33description = ""
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"
55+++
66
77If 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 @@
11+++
22title = "Urbit København"
3−description = "Join us in CPH"
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-cph.png"
3+description = ""
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-cph.png"
55+++
66
77~norsyr-torryn/nordics
content/communities/urbit-dc.md+2−2
@@ -1,7 +1,7 @@
11+++
22title = "DC Metro Urbit Meetup Group"
3−description = "Urbit meetups in the DC area"
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-dc.png"
3+description = ""
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-dc.png"
55+++
66
77This is a DC/Northern Virginia/Southern Maryland Urbit discussion group.
content/communities/urbit-ny.md+2−2
@@ -1,7 +1,7 @@
11+++
22title = "Urbit NY"
3−description = "Urbit meetups in New York"
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-ny.png"
3+description = ""
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-ny.png"
55+++
66
77We love experimenting with Urbit & tinkering with Arvo, Hoon, & Nock
content/communities/urbit-seattle.md+2−2
@@ -1,7 +1,7 @@
11+++
22title = "Urbit Seattle"
3−description = "Urbit meetups in Seattle"
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-seattle.png"
3+description = ""
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-seattle.png"
55+++
66
77Urbit 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 @@
11+++
22title = "Urbit SF"
3−description = "Urbit meetups in San Francisco"
4−tile = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-sf.png"
3+description = ""
4+image = "https://storage.googleapis.com/media.urbit.org/site/ecosystem/communities/urbit-sf.png"
55+++
66
77Want 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({
3232 marketplaces,
3333 organizations,
3434 podcasts,
35− articles
35+ articles,
36+ communities
3637}) {
3738 const router = useRouter();
3839
@@ -53,6 +54,9 @@ export default function Ecosystem({
5354 case "applications":
5455 title = "Applications • Ecosystem";
5556 break;
57+ case "communities":
58+ title = "Communities • Ecosystem";
59+ break;
5660 case "applications":
5761 title = "Groups • Ecosystem";
5862 break;
@@ -124,10 +128,9 @@ export default function Ecosystem({
124128 {/* Ecosystem type layouts */}
125129 <div
126130 className={classnames("grid gap-12 w-full", {
127− "grid-cols-2 md:grid-cols-3": type == "organizations" || type == "marketplaces",
128131 "grid-cols-1": type === "podcasts" || type === "articles",
129132 "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",
131134 hidden: spotlight,
132135 })}
133136 >
@@ -138,6 +141,9 @@ export default function Ecosystem({
138141 {type === "applications" &&
139142 <Applications dir={applications} />
140143 }
144+ {type === "communities" &&
145+ <Communities dir={communities} />
146+ }
141147 {type === "groups" &&
142148 <Groups dir={groups} />
143149 }
@@ -161,16 +167,6 @@ export default function Ecosystem({
161167 );
162168}
163169
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−}
174170
175171const Applications = ({ dir }) => {
176172 return dir.map((app) => (
@@ -230,16 +226,6 @@ const Groups = ({ dir }) => {
230226 ))
231227}
232228
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−}
243229
244230const Podcasts = ({ dir }) => {
245231 return dir.map((pod) => (
@@ -279,6 +265,74 @@ const Articles = ({ dir }) => {
279265 ))
280266}
281267
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+
282336
283337export async function getStaticProps() {
284338 const posts = getAllPosts(
@@ -292,6 +346,7 @@ export async function getStaticProps() {
292346 "date"
293347 )[0]);
294348 const marketplaces = getAllPosts(["title", "image", "slug"], "marketplaces");
349+ const communities = getAllPosts(["title", "image", "slug", "description"], "communities");
295350 const podcasts = getAllPosts(
296351 ["title", "image", "date", "podcast", "slug"],
297352 "podcasts",
@@ -354,7 +409,8 @@ export async function getStaticProps() {
354409 marketplaces,
355410 podcasts,
356411 organizations,
357− articles
412+ articles,
413+ communities
358414 },
359415 };
360416}