on master help sign in
build: bump fds to 0.4.1, use fds imports
commit0366237c02f6066f9f474e4d8235ff3027360bda authorMatilde Park <matilde.park@urbit.org> dateWed 24 Aug 2022, 15:29 (4 years ago) parent73c7e7b
40 files changed+135−372
components/BasicPage.js+1−1 components/Contact.js−2 components/EventPreview.js+4−1 components/GrantProgramOverview.js+1−1 components/Header.js+2−2 components/Pagination.js−2 components/PostPreview.js+5−3 components/Search.js+1−2 components/Snippets.js+1−4 components/TableOfContents.js−131 components/TwoUp.js−12 components/ecosystem/BasicPage.js−1 lib/lib.js+10−131 package-lock.json+28−7 package.json+1−1 pages/[slug].js+5−3 pages/applications/[[...application]].js+2−1 pages/blog.js+4−2 pages/blog/[slug].js+7−10 pages/community/[[...slug]].js+1−2 pages/decentralized-discord.js+1−1 pages/ecosystem/index.js+3−2 pages/ecosystem/spotlight/[slug].js+2−1 pages/events.js+2−1 pages/events/[slug].js+7−11 pages/getting-started/[[...slug]].js+2−7 pages/grants.js+2−1 pages/grants/[slug].js+3−1 pages/grants/apprenticeships.js+1−2 pages/grants/bounties.js+1−2 pages/grants/proposals.js+1−2 pages/groups/[[...group]].js+1−1 pages/ids/[id].js+2−1 pages/index.js+4−2 pages/marketplaces/[slug].js+6−2 pages/organizations/[slug].js+6−2 pages/overview/[[...slug]].js+3−1 pages/podcasts/[slug].js+6−2 pages/updates.js+3−1 pages/updates/[slug].js+6−10
components/BasicPage.js+1−1
@@ -8,11 +8,11 @@ import {
88 Section,
99 Markdown,
1010 IntraNav,
11+ TableOfContents,
1112} from "@urbit/foundation-design-system";
1213import Header from "./Header";
1314import Footer from "./Footer";
1415import classNames from "classnames";
15−import { TableOfContents } from "./TableOfContents";
1616
1717export default function BasicPage({ post, markdown, search, index = false }) {
1818 const router = useRouter();
components/Contact.js−2
@@ -1,6 +1,4 @@
11import NewsletterSignup from "./NewsletterSignup";
2−import { name, contact } from "../lib/constants";
3−import Link from "next/link";
42
53export default function Contact({
64 emphasize,
components/EventPreview.js+4−1
@@ -1,7 +1,10 @@
11import Link from "next/link";
22import { DateTime } from "luxon";
33import { DateRange } from "../components/Snippets";
4−import { generateDisplayDate, generateRealtimeDate } from "../lib/lib";
4+import {
5+ generateDisplayDate,
6+ generateRealtimeDate,
7+} from "@urbit/foundation-design-system";
58import classNames from "classnames";
69
710export default function EventPreview({ event, className, big }) {
components/GrantProgramOverview.js+1−1
@@ -1,5 +1,4 @@
11import { useRouter } from "next/router";
2−import { formatDate } from "../lib/lib";
32import Link from "next/link";
43import Head from "next/head";
54import Meta from "../components/Meta";
@@ -10,6 +9,7 @@ import {
109 SingleColumn,
1110 Markdown,
1211 IntraNav,
12+ formatDate,
1313} from "@urbit/foundation-design-system";
1414import Header from "./Header";
1515import Footer from "./Footer";
components/Header.js+2−2
@@ -1,9 +1,9 @@
11import Link from "next/link";
22import { useRouter } from "next/router";
3−import { useState, useEffect } from "react";
3+import { useState } from "react";
44import classnames from "classnames";
55import MenuTray from "../components/MenuTray";
6−import { capitalize } from "../lib/lib";
6+import { capitalize } from "@urbit/foundation-design-system";
77
88function ActiveLink({ children, href, className, currentPath }) {
99 const firstCrumb = currentPath.split("/")[1];
components/Pagination.js−2
@@ -1,6 +1,4 @@
11import Link from "next/link";
2−import { formatDate } from "../lib/lib";
3−
42export default function Pagination(props) {
53 return (
64 <Link
components/PostPreview.js+5−3
@@ -1,6 +1,8 @@
1−import Link from "next/link";
2−import { Card } from "@urbit/foundation-design-system";
3−import { formatDate, generateDisplayDate } from "../lib/lib";
1+import {
2+ Card,
3+ formatDate,
4+ generateDisplayDate,
5+} from "@urbit/foundation-design-system";
46
57export default function PostPreview(props) {
68 const section = props?.section ? props.section : "blog";
components/Search.js+1−2
@@ -1,10 +1,9 @@
1−import { Component, createRef } from "react";
1+import { Component } from "react";
22import { withRouter } from "next/router";
33import debounce from "lodash.debounce";
44import Downshift from "downshift";
55import ob from "urbit-ob";
66import Sigil from "../components/Sigil";
7−import levenSort from "leven-sort";
87
98class Search extends Component {
109 constructor(props) {
components/Snippets.js+1−4
@@ -1,12 +1,9 @@
11import Link from "next/link";
22import {
3− getAllEvents,
4− generateDisplayDate,
5− generateRealtimeDate,
63 formatDate,
74 formatTime,
85 formatTimeZone,
9−} from "../lib/lib";
6+} from "@urbit/foundation-design-system";
107
118export function Name({ children, className }) {
129 return <b className={`font-normal ${className || ""}`}>{children}</b>;
components/TableOfContents.jsdeleted−131
@@ -1,131 +0,0 @@
1−import { useState, useEffect, useRef } from "react";
2−import classNames from "classnames";
3−
4−export const TableOfContents = ({ staticPosition, noh3s }) => {
5− const { nestedHeadings } = useHeadingsData(noh3s);
6− const [activeId, setActiveId] = useState();
7− useIntersectionObserver(setActiveId);
8− return (
9− <nav
10− className={
11− (staticPosition ? "static" : "sticky") +
12− " min-h-0 overflow-y-auto w-52 shrink-0 pb-24 hidden lg:block pl-4"
13− }
14− style={{ top: "8rem", height: "calc(100vh - 16rem)" }}
15− >
16− <div className="relative after:fixed after:bg-gradient-to-t after:from-white after:via-white after:bottom-0 after:w-52 after:h-60 after:pointer-events-none">
17− <Headings headings={nestedHeadings} activeId={activeId} />
18− </div>
19− </nav>
20− );
21−};
22−
23−const getNestedHeadings = (headingElements) => {
24− const nestedHeadings = [];
25−
26− headingElements.forEach((heading, index) => {
27− const { innerText: title, id } = heading;
28−
29− if (heading.nodeName === "H2") {
30− nestedHeadings.push({ id, title, items: [] });
31− } else if (heading.nodeName === "H3" && nestedHeadings.length > 0) {
32− nestedHeadings[nestedHeadings.length - 1].items.push({
33− id,
34− title,
35− });
36− }
37− });
38−
39− return nestedHeadings;
40−};
41−
42−const useHeadingsData = (noh3s) => {
43− const [nestedHeadings, setNestedHeadings] = useState([]);
44−
45− const query = noh3s ? "h2" : "h2, h3";
46− useEffect(() => {
47− const headingElements = Array.from(document.querySelectorAll(query));
48−
49− const newNestedHeadings = getNestedHeadings(headingElements);
50− setNestedHeadings(newNestedHeadings);
51− }, []);
52−
53− return { nestedHeadings };
54−};
55−
56−const Headings = ({ headings, activeId }) => (
57− <ul
58− className={classNames({
59− hidden: headings.length === 1 && headings?.[0]?.items?.length === 0,
60− })}
61− >
62− {headings.map((heading, index) => (
63− <li key={heading.id}>
64− <a
65− className={classNames({
66− "font-bold": index === 0,
67− "font-medium text-sm": index !== 0,
68− "text-green-400": heading.id === activeId && index !== 0,
69− })}
70− href={`#${heading.id}`}
71− >
72− {heading.title}
73− </a>
74− {heading.items.length > 0 && (
75− <ul className="pl-2 text-xs">
76− {heading.items.map((child) => (
77− <li
78− key={child.id}
79− className={
80− child.id === activeId ? "text-green-400" : "text-wall-500"
81− }
82− >
83− <a href={`#${child.id}`}>{child.title}</a>
84− </li>
85− ))}
86− </ul>
87− )}
88− </li>
89− ))}
90− </ul>
91−);
92−
93−const useIntersectionObserver = (setActiveId) => {
94− const headingElementsRef = useRef({});
95− useEffect(() => {
96− const callback = (headings) => {
97− headingElementsRef.current = headings.reduce((map, headingElement) => {
98− map[headingElement.target.id] = headingElement;
99− return map;
100− }, headingElementsRef.current);
101−
102− const visibleHeadings = [];
103− Object.keys(headingElementsRef.current).forEach((key) => {
104− const headingElement = headingElementsRef.current[key];
105− if (headingElement.isIntersecting) visibleHeadings.push(headingElement);
106− });
107−
108− const getIndexFromId = (id) =>
109− headingElements.findIndex((heading) => heading.id === id);
110−
111− if (visibleHeadings.length === 1) {
112− setActiveId(visibleHeadings[0].target.id);
113− } else if (visibleHeadings.length > 1) {
114− const sortedVisibleHeadings = visibleHeadings.sort(
115− (a, b) => getIndexFromId(a.target.id) > getIndexFromId(b.target.id)
116− );
117− setActiveId(sortedVisibleHeadings[0].target.id);
118− }
119− };
120−
121− const observer = new IntersectionObserver(callback, {
122− rootMargin: "0px 0px -50% 0px",
123− });
124−
125− const headingElements = Array.from(document.querySelectorAll("h2, h3"));
126−
127− headingElements.forEach((element) => observer.observe(element));
128−
129− return () => observer.disconnect();
130− }, [setActiveId]);
131−};
components/TwoUp.jsdeleted−12
@@ -1,12 +0,0 @@
1−export default function TwoUp({ children, className = "" }) {
2− return (
3− <div className={`flex flex-wrap w-full ${className}`}>
4− <div className="w-full md:w-1/2 pr-0 pb-8 md:pr-4">
5− {children[0] || null}
6− </div>
7− <div className="w-full md:w-1/2 pl-0 pb-8 md:pl-4">
8− {children[1] || null}
9− </div>
10− </div>
11− );
12−}
components/ecosystem/BasicPage.js−1
@@ -1,5 +1,4 @@
11import { useRouter } from "next/router";
2−import Link from "next/link";
32import Head from "next/head";
43import Meta from "../Meta";
54import ErrorPage from "../../pages/404";
lib/lib.js+10−131
@@ -3,6 +3,16 @@ import { join, parse } from "path";
33import matter from "gray-matter";
44import toml from "@iarna/toml";
55import { DateTime } from "luxon";
6+import { getPostBySlug, getPostSlugs } from "@urbit/foundation-design-system";
7+
8+// NB Gavin: This could be much simpler if we converted everything to a more common standard, like YAML
9+const options = {
10+ engines: {
11+ toml: toml.parse.bind(toml),
12+ },
13+ language: "toml",
14+ delimiters: "+++",
15+};
616
717const directories = (dir) => {
818 switch (dir) {
@@ -25,49 +35,6 @@ const directories = (dir) => {
2535 }
2636};
2737
28−export function getPostSlugs(key) {
29− const dir = fs.existsSync(directories(key))
30− ? fs.readdirSync(directories(key), { withFileTypes: true })
31− : [];
32− return dir
33− .filter((f) => f.isFile() && f.name !== "_index.md")
34− .map((f) => f.name);
35−}
36−
37−// NB Gavin: This could be much simpler if we converted everything to a more common standard, like YAML
38−const options = {
39− engines: {
40− toml: toml.parse.bind(toml),
41− },
42− language: "toml",
43− delimiters: "+++",
44−};
45−
46−export function getPostBySlug(slug, fields = [], key) {
47− const realSlug = slug.replace(/\.md$/, "");
48− const fullPath = join(directories(key), `${realSlug}.md`);
49− const fileContents = fs.readFileSync(fullPath, "utf8");
50− const { data, content } = matter(fileContents, options);
51− const items = {};
52−
53− // Ensure only the minimal needed data is exposed
54− fields.forEach((field) => {
55− if (field === "slug") {
56− items[field] = realSlug;
57− }
58−
59− if (field === "content") {
60− items[field] = content;
61− }
62−
63− if (data[field]) {
64− items[field] = data[field];
65− }
66− });
67−
68− return items;
69−}
70−
7138export function getAllPosts(fields = [], key, sort = "") {
7239 const slugs = getPostSlugs(key);
7340 const posts = slugs
@@ -116,32 +83,6 @@ export function getDocsPaths() {
11683 return getAllPaths(directories("docs"), []);
11784}
11885
119−export function getNextPost(slug, fields = [], key, sort = "date") {
120− let resultPost = null;
121−
122− getAllPosts(fields, key, sort).forEach((post, index, array) => {
123− if (post.slug === slug) {
124− if (typeof array[index - 1] !== "undefined") {
125− resultPost = array[index - 1];
126− }
127− }
128− });
129− return resultPost;
130−}
131−
132−export function getPreviousPost(slug, fields = [], key, sort = "date") {
133− let resultPost = null;
134−
135− getAllPosts(fields, key, sort).forEach((post, index, array) => {
136− if (post.slug === slug) {
137− if (typeof array[index + 1] !== "undefined") {
138− resultPost = array[index + 1];
139− }
140− }
141− });
142− return resultPost;
143−}
144−
14586export function formatDateWithTime(d) {
14687 const date = DateTime.fromISO(d, {
14788 setZone: true,
@@ -149,73 +90,11 @@ export function formatDateWithTime(d) {
14990 return date;
15091}
15192
152−export function capitalize(str) {
153− return str.charAt(0).toUpperCase() + str.slice(1);
154−}
155−
156−// Takes an ISO 8601 date string
157−// Returns a time relative to the IANA timezone and iso8601 date
158−export function generateDisplayDate(iso8601, zone = "America/Los_Angeles") {
159− return DateTime.fromISO(iso8601, { zone });
160−}
161−
162−// Takes an ISO 8601 date string
163−// Returns a time relative to user's current timezone
164−export function generateRealtimeDate(iso8601) {
165− return DateTime.fromISO(iso8601).setZone("system");
166−}
167−
16893// Formats a DateTime object to something like "July 15, 2021, 5:00 PM"
16994export function formatDateAndTime(dateTimeObject) {
17095 return dateTimeObject.toLocaleString(DateTime.DATETIME_HUGE);
17196}
17297
173−// Formats a DateTime object to something like "5:00 PM"
174−export function formatTime(dateTimeObject) {
175− const dt = dateTimeObject.toLocaleString(DateTime.TIME_SIMPLE);
176− return dt.replace(/:00/g, "");
177−}
178−
179−export function formatTimeZone(dateTimeObject) {
180− return dateTimeObject.offsetNameShort;
181−}
182−
183−// Formats a DateTime object to something like "Jul 15, 2021"
184−export function formatDate(dateTimeObject) {
185− return dateTimeObject.toLocaleString(DateTime.DATE_FULL);
186−}
187−
188−// export function generateCrumbs(path) {
189−// const crumbs = path.split('/')
190−// return crumbs
191−// .filter(v => v !== '')
192−// .map((crumb, index) => ({
193−// name: capitalize(crumb),
194−// key: crumb,
195−// path: crumbs.slice(0, index+2).join('/'),
196−// }))
197−// }
198−
199−export const getPage = (path) => {
200− try {
201− let fileContents = fs.readFileSync(`${path}.md`, "utf8");
202− if (fileContents) {
203− const { data, content } = matter(fileContents, options);
204− return { data, content };
205− }
206− } catch {
207− try {
208− let fileContents = fs.readFileSync(`${path}/_index.md`, "utf8");
209− if (fileContents) {
210− const { data, content } = matter(fileContents, options);
211− return { data, content };
212− }
213− } catch {
214− console.error("no md file for slug");
215− }
216− }
217−};
218−
21998// Returns an array of unique grants categories
22099export function getGrantsCategories() {
221100 const paths = fs.readdirSync(directories("grants"));
package-lock.json+28−7
@@ -12,7 +12,7 @@
1212 "@socialgouv/matomo-next": "^1.3.0",
1313 "@tailwindcss/aspect-ratio": "^0.4.0",
1414 "@tlon/sigil-js": "^1.4.5",
15− "@urbit/foundation-design-system": "^0.3.1",
15+ "@urbit/foundation-design-system": "^0.4.1",
1616 "@urbit/markdoc": "^0.1.4",
1717 "axios": "^0.26.1",
1818 "buffer": "^6.0.3",
@@ -358,12 +358,15 @@
358358 "dev": true
359359 },
360360 "node_modules/@urbit/foundation-design-system": {
361− "version": "0.3.1",
362− "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.3.1.tgz",
363− "integrity": "sha512-6FeXqO5wTlYv3nDKjEzj2hW7v4NMtgrBp3/JTN0G/0cFqWuQOcH0SCziuNHVYB7jneYcMiiHqhf6JxPPACEsng==",
361+ "version": "0.4.1",
362+ "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.4.1.tgz",
363+ "integrity": "sha512-EFGtqABqIlJYQhaCJ7p/GlS0Wq2MrtF1H0vXC5p1l+na+aV5CGT0oXIR5dDt4hUgCD1gh9rX0QI9qnu2YKpAeA==",
364364 "dependencies": {
365+ "@iarna/toml": "^2.2.5",
365366 "core-js": "^3.23.1",
367+ "gray-matter": "^4.0.3",
366368 "html-react-parser": "^1.4.14",
369+ "luxon": "^3.0.1",
367370 "prism-react-renderer": "^1.3.3"
368371 },
369372 "peerDependencies": {
@@ -380,6 +383,14 @@
380383 "tailwindcss-theme-swapper": "^0.6.2"
381384 }
382385 },
386+ "node_modules/@urbit/foundation-design-system/node_modules/luxon": {
387+ "version": "3.0.1",
388+ "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.0.1.tgz",
389+ "integrity": "sha512-hF3kv0e5gwHQZKz4wtm4c+inDtyc7elkanAsBq+fundaCdUBNJB1dHEGUZIM6SfSBUlbVFduPwEtNjFK8wLtcw==",
390+ "engines": {
391+ "node": ">=12"
392+ }
393+ },
383394 "node_modules/@urbit/markdoc": {
384395 "version": "0.1.6",
385396 "resolved": "https://registry.npmjs.org/@urbit/markdoc/-/markdoc-0.1.6.tgz",
@@ -3304,13 +3315,23 @@
33043315 "dev": true
33053316 },
33063317 "@urbit/foundation-design-system": {
3307− "version": "0.3.1",
3308− "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.3.1.tgz",
3309− "integrity": "sha512-6FeXqO5wTlYv3nDKjEzj2hW7v4NMtgrBp3/JTN0G/0cFqWuQOcH0SCziuNHVYB7jneYcMiiHqhf6JxPPACEsng==",
3318+ "version": "0.4.1",
3319+ "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.4.1.tgz",
3320+ "integrity": "sha512-EFGtqABqIlJYQhaCJ7p/GlS0Wq2MrtF1H0vXC5p1l+na+aV5CGT0oXIR5dDt4hUgCD1gh9rX0QI9qnu2YKpAeA==",
33103321 "requires": {
3322+ "@iarna/toml": "^2.2.5",
33113323 "core-js": "^3.23.1",
3324+ "gray-matter": "^4.0.3",
33123325 "html-react-parser": "^1.4.14",
3326+ "luxon": "^3.0.1",
33133327 "prism-react-renderer": "^1.3.3"
3328+ },
3329+ "dependencies": {
3330+ "luxon": {
3331+ "version": "3.0.1",
3332+ "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.0.1.tgz",
3333+ "integrity": "sha512-hF3kv0e5gwHQZKz4wtm4c+inDtyc7elkanAsBq+fundaCdUBNJB1dHEGUZIM6SfSBUlbVFduPwEtNjFK8wLtcw=="
3334+ }
33143335 }
33153336 },
33163337 "@urbit/markdoc": {
package.json+1−1
@@ -20,7 +20,7 @@
2020 "@socialgouv/matomo-next": "^1.3.0",
2121 "@tailwindcss/aspect-ratio": "^0.4.0",
2222 "@tlon/sigil-js": "^1.4.5",
23− "@urbit/foundation-design-system": "^0.3.1",
23+ "@urbit/foundation-design-system": "^0.4.1",
2424 "@urbit/markdoc": "^0.1.4",
2525 "axios": "^0.26.1",
2626 "buffer": "^6.0.3",
pages/[slug].js+5−3
@@ -1,7 +1,9 @@
1−import { getPostBySlug } from "../lib/lib";
21import BasicPage from "../components/BasicPage";
3−import { getPostSlugs } from "../lib/lib";
4−import { Markdown } from "@urbit/foundation-design-system";
2+import {
3+ Markdown,
4+ getPostBySlug,
5+ getPostSlugs,
6+} from "@urbit/foundation-design-system";
57
68export default function Post({ post, markdown, search, index }) {
79 return (
pages/applications/[[...application]].js+2−1
@@ -1,6 +1,5 @@
11import Head from "next/head";
22import Link from "next/link";
3−import { getPage, getAllPosts } from "../../lib/lib";
43import { join } from "path";
54import CopyLink from "../../components/CopyLink";
65import {
@@ -9,6 +8,8 @@ import {
98 Section,
109 Markdown,
1110 IntraNav,
11+ getPage,
12+ getAllPosts,
1213} from "@urbit/foundation-design-system";
1314import ob from "urbit-ob";
1415import Header from "../../components/Header";
pages/blog.js+4−2
@@ -6,11 +6,13 @@ import {
66 SingleColumn,
77 Section,
88 IntraNav,
9+ getAllPosts,
10+ formatDate,
11+ generateDisplayDate,
912} from "@urbit/foundation-design-system";
1013import Footer from "../components/Footer";
1114import Header from "../components/Header";
1215import BackgroundImage from "../components/BackgroundImage";
13−import { getAllPosts, formatDate, generateDisplayDate } from "../lib/lib";
1416import { contact } from "../lib/constants";
1517
1618export default function Blog({ posts, search }) {
@@ -48,7 +50,7 @@ export default function Blog({ posts, search }) {
4850 <div key={post.slug} className="mb-20 cursor-pointer">
4951 <Link href={`/blog/${post.slug}`}>
5052 <div class="flex items-center md:flex-row flex-col">
51− <div class="flex w-full rounded-lg aspect-h-4 w-full">
53+ <div class="flex w-full rounded-lg aspect-h-4">
5254 {
5355 // Not all blog posts have images
5456 post.extra.image ? (
pages/blog/[slug].js+7−10
@@ -1,13 +1,4 @@
11import { useRouter } from "next/router";
2−import { useState, useEffect } from "react";
3−import {
4− getPostBySlug,
5− getAllPosts,
6− getNextPost,
7− getPreviousPost,
8− formatDate,
9− generateDisplayDate,
10−} from "../../lib/lib";
112import Head from "next/head";
123import Link from "next/link";
134import Meta from "../../components/Meta";
@@ -18,11 +9,17 @@ import {
189 IntraNav,
1910 SingleColumn,
2011 Section,
12+ TwoUp,
13+ getPostBySlug,
14+ getAllPosts,
15+ getNextPost,
16+ getPreviousPost,
17+ formatDate,
18+ generateDisplayDate,
2119} from "@urbit/foundation-design-system";
2220import Header from "../../components/Header";
2321import Footer from "../../components/Footer";
2422import PostPreview from "../../components/PostPreview";
25−import TwoUp from "../../components/TwoUp";
2623
2724export default function Post({
2825 post,
pages/community/[[...slug]].js+1−2
@@ -3,9 +3,8 @@ import Link from "next/link";
33import { useRouter } from "next/router";
44import classnames from "classnames";
55import { join } from "path";
6−import { getPage } from "../../lib/lib";
76import Meta from "../../components/Meta";
8−import { Markdown } from "@urbit/foundation-design-system";
7+import { Markdown, getPage } from "@urbit/foundation-design-system";
98import ContentArea from "../../components/ContentArea";
109import Sidebar from "../../components/DocsSidebar";
1110import communityTree from "../../cache/community.json";
pages/decentralized-discord.js+1−1
@@ -7,8 +7,8 @@ import {
77 SingleColumn,
88 IntraNav,
99 TwoUp,
10+ getPostBySlug,
1011} from "@urbit/foundation-design-system";
11−import { getPostBySlug } from "../lib/lib";
1212import Meta from "../components/Meta";
1313import Header from "../components/Header";
1414import Footer from "../components/Footer";
pages/ecosystem/index.js+3−2
@@ -7,6 +7,9 @@ import {
77 Section,
88 IntraNav,
99 Markdown,
10+ getAllPosts,
11+ generateDisplayDate,
12+ formatDate,
1013} from "@urbit/foundation-design-system";
1114import Header from "../../components/Header";
1215import Footer from "../../components/Footer";
@@ -14,11 +17,9 @@ import Sidebar from "../../components/Sidebar";
1417import Post from "../../components/ecosystem/Post";
1518import classnames from "classnames";
1619import Link from "next/link";
17−import { getAllPosts } from "../../lib/lib";
1820import fs from "fs";
1921import path from "path";
2022import Contact from "../../components/Contact";
21−import { generateDisplayDate, formatDate } from "../../lib/lib";
2223
2324export default function Ecosystem({
2425 search,
pages/ecosystem/spotlight/[slug].js+2−1
@@ -8,11 +8,12 @@ import {
88 Section,
99 Markdown,
1010 IntraNav,
11+ getAllPosts,
12+ getPostBySlug,
1113} from "@urbit/foundation-design-system";
1214import Header from "../../../components/Header";
1315import Footer from "../../../components/Footer";
1416import Post from "../../../components/ecosystem/Post";
15−import { getAllPosts, getPostBySlug } from "../../../lib/lib";
1617import fs from "fs";
1718import path from "path";
1819
pages/events.js+2−1
@@ -9,11 +9,12 @@ import {
99 Section,
1010 IntraNav,
1111 TwoUp,
12+ generateRealtimeDate,
1213} from "@urbit/foundation-design-system";
1314import Footer from "../components/Footer";
1415import Header from "../components/Header";
1516import EventPreview from "../components/EventPreview";
16−import { getAllEvents, generateRealtimeDate, pair } from "../lib/lib";
17+import { getAllEvents, pair } from "../lib/lib";
1718
1819import { eventKeys } from "../lib/constants";
1920
pages/events/[slug].js+7−11
@@ -1,12 +1,4 @@
11import { DateTime } from "luxon";
2−import {
3− getPostBySlug,
4− getAllPosts,
5− getNextPost,
6− getPreviousPost,
7− generateDisplayDate,
8− generateRealtimeDate,
9−} from "../../lib/lib";
102import Head from "next/head";
113import Meta from "../../components/Meta";
124import {
@@ -15,13 +7,17 @@ import {
157 SingleColumn,
168 Section,
179 IntraNav,
10+ TwoUp,
11+ getPostBySlug,
12+ getAllPosts,
13+ getNextPost,
14+ getPreviousPost,
15+ generateDisplayDate,
16+ generateRealtimeDate,
1817} from "@urbit/foundation-design-system";
1918import Header from "../../components/Header";
2019import Footer from "../../components/Footer";
21−import Contact from "../../components/Contact";
2220import EventPreview from "../../components/EventPreview";
23−import TwoUp from "../../components/TwoUp";
24−
2521import {
2622 Person,
2723 ReadableList,
pages/getting-started/[[...slug]].js+2−7
@@ -4,8 +4,7 @@ import Link from "next/link";
44import { useRouter } from "next/router";
55import classnames from "classnames";
66import { join } from "path";
7−import { getPage } from "../../lib/lib";
8−import { Markdown } from "@urbit/foundation-design-system";
7+import { Markdown, getPage } from "@urbit/foundation-design-system";
98import ContentArea from "../../components/ContentArea";
109import Sidebar from "../../components/DocsSidebar";
1110import GettingStartedTree from "../../cache/getting-started.json";
@@ -212,9 +211,7 @@ function LaunchCards() {
212211 },
213212 {
214213 title: "Considerations",
215− content: [
216− "Requires familiarity with the command line",
217− ],
214+ content: ["Requires familiarity with the command line"],
218215 },
219216 ],
220217 svg: (
@@ -231,8 +228,6 @@ function LaunchCards() {
231228 d="M52.9288 0.03125H3.07125C1.39393 0.03125 0.03125 1.39393 0.03125 3.07125V52.9288C0.03125 53.7333 0.351879 54.5081 0.921894 55.0781C1.49191 55.6481 2.26671 55.9688 3.07125 55.9688H52.9288C53.7333 55.9688 54.5081 55.6481 55.0781 55.0781C55.6481 54.5081 55.9688 53.7333 55.9688 52.9288V3.07125C55.9688 2.26671 55.6481 1.49189 55.0781 0.921894C54.5081 0.351894 53.7333 0.03125 52.9288 0.03125V0.03125ZM12.8 38.7912L20.78 30.7368L12.8 22.7568L17.1314 18.4254L27.2402 28.6079C27.8191 29.1779 28.1456 29.9586 28.1456 30.7721C28.1456 31.5885 27.8191 32.3693 27.2402 32.9393L17.0577 43.0481L12.8 38.7912ZM38.9425 43.1226H27.0113V37.0426H38.8688L38.9425 43.1226Z"
232229 className="fill-wall-600"
233230 />
234−
235−
236231 </svg>
237232 ),
238233 href: "/getting-started/cli",
pages/grants.js+2−1
@@ -7,13 +7,14 @@ import {
77 SingleColumn,
88 Section,
99 IntraNav,
10+ getAllPosts,
1011} from "@urbit/foundation-design-system";
1112import Footer from "../components/Footer";
1213import Header from "../components/Header";
1314import GrantPreview from "../components/GrantPreview";
1415import JoinGroup from "../components/JoinGroup";
1516import omit from "lodash.omit";
16−import { getAllPosts, getGrantsCategories, getGrantsTypes } from "../lib/lib";
17+import { getGrantsCategories, getGrantsTypes } from "../lib/lib";
1718
1819function isArray(arr) {
1920 return Array.isArray(arr);
pages/grants/[slug].js+3−1
@@ -1,5 +1,4 @@
11import { useRouter } from "next/router";
2−import { getPostBySlug, getAllPosts, formatDate } from "../../lib/lib";
32import Head from "next/head";
43import Link from "next/link";
54import Meta from "../../components/Meta";
@@ -11,6 +10,9 @@ import {
1110 SingleColumn,
1211 Section,
1312 IntraNav,
13+ getPostBySlug,
14+ getAllPosts,
15+ formatDate,
1416} from "@urbit/foundation-design-system";
1517import Header from "../../components/Header";
1618import Footer from "../../components/Footer";
pages/grants/apprenticeships.js+1−2
@@ -1,6 +1,5 @@
1−import { getPostBySlug } from "../../lib/lib";
21import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
43
54export default function Post({ post, markdown, search }) {
65 return (
pages/grants/bounties.js+1−2
@@ -1,6 +1,5 @@
1−import { getPostBySlug } from "../../lib/lib";
21import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
43
54export default function Post({ post, markdown, search }) {
65 return (
pages/grants/proposals.js+1−2
@@ -1,6 +1,5 @@
1−import { getPostBySlug } from "../../lib/lib";
21import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
43
54export default function Post({ post, markdown, search }) {
65 return (
pages/groups/[[...group]].js+1−1
@@ -1,6 +1,5 @@
11import Head from "next/head";
22import Link from "next/link";
3−import { getPage } from "../../lib/lib";
43import { join } from "path";
54import CopyLink from "../../components/CopyLink";
65import {
@@ -8,6 +7,7 @@ import {
87 SingleColumn,
98 Section,
109 Markdown,
10+ getPage,
1111} from "@urbit/foundation-design-system";
1212import ob from "urbit-ob";
1313import Header from "../../components/Header";
pages/ids/[id].js+2−1
@@ -1,12 +1,13 @@
11import Head from "next/head";
22import Link from "next/link";
3−import { getPage, getAllPosts } from "../../lib/lib";
43import { join } from "path";
54import {
65 Container,
76 SingleColumn,
87 Section,
98 Markdown,
9+ getPage,
10+ getAllPosts,
1011} from "@urbit/foundation-design-system";
1112import ob from "urbit-ob";
1213import ResourceCard from "../../components/gateway/ResourceCard";
pages/index.js+4−2
@@ -6,15 +6,17 @@ import {
66 Container,
77 Section,
88 SingleColumn,
9+ TwoUp,
910 IntraNav,
11+ getAllPosts,
12+ generateRealtimeDate,
1013} from "@urbit/foundation-design-system";
14+import { getAllEvents } from "../lib/lib";
1115import Header from "../components/Header";
1216import Footer from "../components/Footer";
1317import Contact from "../components/Contact";
1418import PostPreview from "../components/PostPreview";
1519import EventPreview from "../components/EventPreview";
16−import TwoUp from "../components/TwoUp";
17−import { getAllPosts, getAllEvents, generateRealtimeDate } from "../lib/lib";
1820import { eventKeys } from "../lib/constants";
1921import IndexCard from "../components/ecosystem/IndexCard";
2022import fs from "fs";
pages/marketplaces/[slug].js+6−2
@@ -1,6 +1,10 @@
1−import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
21import BasicPage from "../../components/ecosystem/BasicPage";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
7+} from "@urbit/foundation-design-system";
48import Link from "next/link";
59
610export default function Marketplace({
pages/organizations/[slug].js+6−2
@@ -1,6 +1,10 @@
1−import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
21import BasicPage from "../../components/ecosystem/BasicPage";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
7+} from "@urbit/foundation-design-system";
48import Link from "next/link";
59import fs from "fs";
610import path from "path";
pages/overview/[[...slug]].js+3−1
@@ -8,9 +8,11 @@ import {
88 Section,
99 Markdown,
1010 IntraNav,
11+ getPage,
12+ getPreviousPost,
13+ getNextPost,
1114} from "@urbit/foundation-design-system";
1215import { join } from "path";
13−import { getPage, getPreviousPost, getNextPost } from "../../lib/lib";
1416import Header from "../../components/Header";
1517import Footer from "../../components/Footer";
1618import Sidebar from "../../components/Sidebar";
pages/podcasts/[slug].js+6−2
@@ -1,6 +1,10 @@
1−import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
21import BasicPage from "../../components/ecosystem/BasicPage";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
7+} from "@urbit/foundation-design-system";
48import Link from "next/link";
59
610export default function Podcast({
pages/updates.js+3−1
@@ -6,10 +6,12 @@ import {
66 SingleColumn,
77 Section,
88 IntraNav,
9+ getAllPosts,
10+ formatDate,
11+ generateDisplayDate,
912} from "@urbit/foundation-design-system";
1013import Footer from "../components/Footer";
1114import Header from "../components/Header";
12−import { getAllPosts, formatDate, generateDisplayDate } from "../lib/lib";
1315
1416export default function Updates({ posts, search }) {
1517 const post = {
pages/updates/[slug].js+6−10
@@ -1,12 +1,4 @@
11import { useRouter } from "next/router";
2−import {
3− getPostBySlug,
4− getAllPosts,
5− getNextPost,
6− getPreviousPost,
7− formatDate,
8− generateDisplayDate,
9−} from "../../lib/lib";
102import Head from "next/head";
113import Meta from "../../components/Meta";
124import ErrorPage from "../404";
@@ -16,10 +8,15 @@ import {
168 SingleColumn,
179 Section,
1810 IntraNav,
11+ getPostBySlug,
12+ getAllPosts,
13+ getNextPost,
14+ getPreviousPost,
15+ formatDate,
16+ generateDisplayDate,
1917} from "@urbit/foundation-design-system";
2018import Header from "../../components/Header";
2119import Footer from "../../components/Footer";
22−import Contact from "../../components/Contact";
2320
2421export default function Post({ post, markdown, search }) {
2522 const router = useRouter();
@@ -57,7 +54,6 @@ export default function Post({ post, markdown, search }) {
5754 <Section narrow className="markdown">
5855 <Markdown.render content={JSON.parse(markdown)} />
5956 </Section>
60− <Section narrow>/></Section>
6157 <Section wide className="flex">
6258 {
6359 // {previousPost === null ? (