on master help sign in
build: bump fds to 0.4.1, use fds imports
0366237Matilde Park
components/BasicPage.js+1−1
@@ -8,11 +8,11 @@ import {
8 Section,
8 Section,
9 Markdown,
9 Markdown,
10 IntraNav,
10 IntraNav,
11+ TableOfContents,
11} from "@urbit/foundation-design-system";
12} from "@urbit/foundation-design-system";
12import Header from "./Header";
13import Header from "./Header";
13import Footer from "./Footer";
14import Footer from "./Footer";
14import classNames from "classnames";
15import classNames from "classnames";
15−import { TableOfContents } from "./TableOfContents";
16
16
17export default function BasicPage({ post, markdown, search, index = false }) {
17export default function BasicPage({ post, markdown, search, index = false }) {
18 const router = useRouter();
18 const router = useRouter();
components/Contact.js−2
@@ -1,6 +1,4 @@
1import NewsletterSignup from "./NewsletterSignup";
1import NewsletterSignup from "./NewsletterSignup";
2−import { name, contact } from "../lib/constants";
3−import Link from "next/link";
4
2
5export default function Contact({
3export default function Contact({
6 emphasize,
4 emphasize,
components/EventPreview.js+4−1
@@ -1,7 +1,10 @@
1import Link from "next/link";
1import Link from "next/link";
2import { DateTime } from "luxon";
2import { DateTime } from "luxon";
3import { DateRange } from "../components/Snippets";
3import { DateRange } from "../components/Snippets";
4+import {
5+ generateDisplayDate,
4−import { generateDisplayDate, generateRealtimeDate } from "../lib/lib";
6+ generateRealtimeDate,
7+} from "@urbit/foundation-design-system";
5import classNames from "classnames";
8import classNames from "classnames";
6
9
7export default function EventPreview({ event, className, big }) {
10export default function EventPreview({ event, className, big }) {
components/GrantProgramOverview.js+1−1
@@ -1,5 +1,4 @@
1import { useRouter } from "next/router";
1import { useRouter } from "next/router";
2−import { formatDate } from "../lib/lib";
3import Link from "next/link";
2import Link from "next/link";
4import Head from "next/head";
3import Head from "next/head";
5import Meta from "../components/Meta";
4import Meta from "../components/Meta";
@@ -10,6 +9,7 @@ import {
10 SingleColumn,
9 SingleColumn,
11 Markdown,
10 Markdown,
12 IntraNav,
11 IntraNav,
12+ formatDate,
13} from "@urbit/foundation-design-system";
13} from "@urbit/foundation-design-system";
14import Header from "./Header";
14import Header from "./Header";
15import Footer from "./Footer";
15import Footer from "./Footer";
components/Header.js+2−2
@@ -1,9 +1,9 @@
1import Link from "next/link";
1import Link from "next/link";
2import { useRouter } from "next/router";
2import { useRouter } from "next/router";
3−import { useState, useEffect } from "react";
3+import { useState } from "react";
4import classnames from "classnames";
4import classnames from "classnames";
5import MenuTray from "../components/MenuTray";
5import MenuTray from "../components/MenuTray";
6−import { capitalize } from "../lib/lib";
6+import { capitalize } from "@urbit/foundation-design-system";
7
7
8function ActiveLink({ children, href, className, currentPath }) {
8function ActiveLink({ children, href, className, currentPath }) {
9 const firstCrumb = currentPath.split("/")[1];
9 const firstCrumb = currentPath.split("/")[1];
components/Pagination.js−2
@@ -1,6 +1,4 @@
1import Link from "next/link";
1import Link from "next/link";
2−import { formatDate } from "../lib/lib";
3−
4export default function Pagination(props) {
2export default function Pagination(props) {
5 return (
3 return (
6 <Link
4 <Link
components/PostPreview.js+5−3
@@ -1,6 +1,8 @@
1−import Link from "next/link";
1+import {
2+ Card,
3+ formatDate,
4+ generateDisplayDate,
2−import { Card } from "@urbit/foundation-design-system";
5+} from "@urbit/foundation-design-system";
3−import { formatDate, generateDisplayDate } from "../lib/lib";
4
6
5export default function PostPreview(props) {
7export default function PostPreview(props) {
6 const section = props?.section ? props.section : "blog";
8 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";
2import { withRouter } from "next/router";
2import { withRouter } from "next/router";
3import debounce from "lodash.debounce";
3import debounce from "lodash.debounce";
4import Downshift from "downshift";
4import Downshift from "downshift";
5import ob from "urbit-ob";
5import ob from "urbit-ob";
6import Sigil from "../components/Sigil";
6import Sigil from "../components/Sigil";
7−import levenSort from "leven-sort";
8
7
9class Search extends Component {
8class Search extends Component {
10 constructor(props) {
9 constructor(props) {
components/Snippets.js+1−4
@@ -1,12 +1,9 @@
1import Link from "next/link";
1import Link from "next/link";
2import {
2import {
3− getAllEvents,
4− generateDisplayDate,
5− generateRealtimeDate,
6 formatDate,
3 formatDate,
7 formatTime,
4 formatTime,
8 formatTimeZone,
5 formatTimeZone,
9−} from "../lib/lib";
6+} from "@urbit/foundation-design-system";
10
7
11export function Name({ children, className }) {
8export function Name({ children, className }) {
12 return <b className={`font-normal ${className || ""}`}>{children}</b>;
9 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 @@
1import { useRouter } from "next/router";
1import { useRouter } from "next/router";
2−import Link from "next/link";
3import Head from "next/head";
2import Head from "next/head";
4import Meta from "../Meta";
3import Meta from "../Meta";
5import ErrorPage from "../../pages/404";
4import ErrorPage from "../../pages/404";
lib/lib.js+10−131
@@ -3,6 +3,16 @@ import { join, parse } from "path";
3import matter from "gray-matter";
3import matter from "gray-matter";
4import toml from "@iarna/toml";
4import toml from "@iarna/toml";
5import { DateTime } from "luxon";
5import { 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+};
6
16
7const directories = (dir) => {
17const directories = (dir) => {
8 switch (dir) {
18 switch (dir) {
@@ -25,49 +35,6 @@ const directories = (dir) => {
25 }
35 }
26};
36};
27
37
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−
71export function getAllPosts(fields = [], key, sort = "") {
38export function getAllPosts(fields = [], key, sort = "") {
72 const slugs = getPostSlugs(key);
39 const slugs = getPostSlugs(key);
73 const posts = slugs
40 const posts = slugs
@@ -116,32 +83,6 @@ export function getDocsPaths() {
116 return getAllPaths(directories("docs"), []);
83 return getAllPaths(directories("docs"), []);
117}
84}
118
85
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−
145export function formatDateWithTime(d) {
86export function formatDateWithTime(d) {
146 const date = DateTime.fromISO(d, {
87 const date = DateTime.fromISO(d, {
147 setZone: true,
88 setZone: true,
@@ -149,73 +90,11 @@ export function formatDateWithTime(d) {
149 return date;
90 return date;
150}
91}
151
92
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−
168// Formats a DateTime object to something like "July 15, 2021, 5:00 PM"
93// Formats a DateTime object to something like "July 15, 2021, 5:00 PM"
169export function formatDateAndTime(dateTimeObject) {
94export function formatDateAndTime(dateTimeObject) {
170 return dateTimeObject.toLocaleString(DateTime.DATETIME_HUGE);
95 return dateTimeObject.toLocaleString(DateTime.DATETIME_HUGE);
171}
96}
172
97
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−
219// Returns an array of unique grants categories
98// Returns an array of unique grants categories
220export function getGrantsCategories() {
99export function getGrantsCategories() {
221 const paths = fs.readdirSync(directories("grants"));
100 const paths = fs.readdirSync(directories("grants"));
package-lock.json+28−7
@@ -12,7 +12,7 @@
12 "@socialgouv/matomo-next": "^1.3.0",
12 "@socialgouv/matomo-next": "^1.3.0",
13 "@tailwindcss/aspect-ratio": "^0.4.0",
13 "@tailwindcss/aspect-ratio": "^0.4.0",
14 "@tlon/sigil-js": "^1.4.5",
14 "@tlon/sigil-js": "^1.4.5",
15− "@urbit/foundation-design-system": "^0.3.1",
15+ "@urbit/foundation-design-system": "^0.4.1",
16 "@urbit/markdoc": "^0.1.4",
16 "@urbit/markdoc": "^0.1.4",
17 "axios": "^0.26.1",
17 "axios": "^0.26.1",
18 "buffer": "^6.0.3",
18 "buffer": "^6.0.3",
@@ -358,12 +358,15 @@
358 "dev": true
358 "dev": true
359 },
359 },
360 "node_modules/@urbit/foundation-design-system": {
360 "node_modules/@urbit/foundation-design-system": {
361− "version": "0.3.1",
361+ "version": "0.4.1",
362− "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.3.1.tgz",
362+ "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.4.1.tgz",
363− "integrity": "sha512-6FeXqO5wTlYv3nDKjEzj2hW7v4NMtgrBp3/JTN0G/0cFqWuQOcH0SCziuNHVYB7jneYcMiiHqhf6JxPPACEsng==",
363+ "integrity": "sha512-EFGtqABqIlJYQhaCJ7p/GlS0Wq2MrtF1H0vXC5p1l+na+aV5CGT0oXIR5dDt4hUgCD1gh9rX0QI9qnu2YKpAeA==",
364 "dependencies": {
364 "dependencies": {
365+ "@iarna/toml": "^2.2.5",
365 "core-js": "^3.23.1",
366 "core-js": "^3.23.1",
367+ "gray-matter": "^4.0.3",
366 "html-react-parser": "^1.4.14",
368 "html-react-parser": "^1.4.14",
369+ "luxon": "^3.0.1",
367 "prism-react-renderer": "^1.3.3"
370 "prism-react-renderer": "^1.3.3"
368 },
371 },
369 "peerDependencies": {
372 "peerDependencies": {
@@ -380,6 +383,14 @@
380 "tailwindcss-theme-swapper": "^0.6.2"
383 "tailwindcss-theme-swapper": "^0.6.2"
381 }
384 }
382 },
385 },
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+ },
383 "node_modules/@urbit/markdoc": {
394 "node_modules/@urbit/markdoc": {
384 "version": "0.1.6",
395 "version": "0.1.6",
385 "resolved": "https://registry.npmjs.org/@urbit/markdoc/-/markdoc-0.1.6.tgz",
396 "resolved": "https://registry.npmjs.org/@urbit/markdoc/-/markdoc-0.1.6.tgz",
@@ -3304,13 +3315,23 @@
3304 "dev": true
3315 "dev": true
3305 },
3316 },
3306 "@urbit/foundation-design-system": {
3317 "@urbit/foundation-design-system": {
3307− "version": "0.3.1",
3318+ "version": "0.4.1",
3308− "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.3.1.tgz",
3319+ "resolved": "https://registry.npmjs.org/@urbit/foundation-design-system/-/foundation-design-system-0.4.1.tgz",
3309− "integrity": "sha512-6FeXqO5wTlYv3nDKjEzj2hW7v4NMtgrBp3/JTN0G/0cFqWuQOcH0SCziuNHVYB7jneYcMiiHqhf6JxPPACEsng==",
3320+ "integrity": "sha512-EFGtqABqIlJYQhaCJ7p/GlS0Wq2MrtF1H0vXC5p1l+na+aV5CGT0oXIR5dDt4hUgCD1gh9rX0QI9qnu2YKpAeA==",
3310 "requires": {
3321 "requires": {
3322+ "@iarna/toml": "^2.2.5",
3311 "core-js": "^3.23.1",
3323 "core-js": "^3.23.1",
3324+ "gray-matter": "^4.0.3",
3312 "html-react-parser": "^1.4.14",
3325 "html-react-parser": "^1.4.14",
3326+ "luxon": "^3.0.1",
3313 "prism-react-renderer": "^1.3.3"
3327 "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+ }
3314 }
3335 }
3315 },
3336 },
3316 "@urbit/markdoc": {
3337 "@urbit/markdoc": {
package.json+1−1
@@ -20,7 +20,7 @@
20 "@socialgouv/matomo-next": "^1.3.0",
20 "@socialgouv/matomo-next": "^1.3.0",
21 "@tailwindcss/aspect-ratio": "^0.4.0",
21 "@tailwindcss/aspect-ratio": "^0.4.0",
22 "@tlon/sigil-js": "^1.4.5",
22 "@tlon/sigil-js": "^1.4.5",
23− "@urbit/foundation-design-system": "^0.3.1",
23+ "@urbit/foundation-design-system": "^0.4.1",
24 "@urbit/markdoc": "^0.1.4",
24 "@urbit/markdoc": "^0.1.4",
25 "axios": "^0.26.1",
25 "axios": "^0.26.1",
26 "buffer": "^6.0.3",
26 "buffer": "^6.0.3",
pages/[slug].js+5−3
@@ -1,7 +1,9 @@
1−import { getPostBySlug } from "../lib/lib";
2import BasicPage from "../components/BasicPage";
1import BasicPage from "../components/BasicPage";
2+import {
3+ Markdown,
4+ getPostBySlug,
3−import { getPostSlugs } from "../lib/lib";
5+ getPostSlugs,
4−import { Markdown } from "@urbit/foundation-design-system";
6+} from "@urbit/foundation-design-system";
5
7
6export default function Post({ post, markdown, search, index }) {
8export default function Post({ post, markdown, search, index }) {
7 return (
9 return (
pages/applications/[[...application]].js+2−1
@@ -1,6 +1,5 @@
1import Head from "next/head";
1import Head from "next/head";
2import Link from "next/link";
2import Link from "next/link";
3−import { getPage, getAllPosts } from "../../lib/lib";
4import { join } from "path";
3import { join } from "path";
5import CopyLink from "../../components/CopyLink";
4import CopyLink from "../../components/CopyLink";
6import {
5import {
@@ -9,6 +8,8 @@ import {
9 Section,
8 Section,
10 Markdown,
9 Markdown,
11 IntraNav,
10 IntraNav,
11+ getPage,
12+ getAllPosts,
12} from "@urbit/foundation-design-system";
13} from "@urbit/foundation-design-system";
13import ob from "urbit-ob";
14import ob from "urbit-ob";
14import Header from "../../components/Header";
15import Header from "../../components/Header";
pages/blog.js+4−2
@@ -6,11 +6,13 @@ import {
6 SingleColumn,
6 SingleColumn,
7 Section,
7 Section,
8 IntraNav,
8 IntraNav,
9+ getAllPosts,
10+ formatDate,
11+ generateDisplayDate,
9} from "@urbit/foundation-design-system";
12} from "@urbit/foundation-design-system";
10import Footer from "../components/Footer";
13import Footer from "../components/Footer";
11import Header from "../components/Header";
14import Header from "../components/Header";
12import BackgroundImage from "../components/BackgroundImage";
15import BackgroundImage from "../components/BackgroundImage";
13−import { getAllPosts, formatDate, generateDisplayDate } from "../lib/lib";
14import { contact } from "../lib/constants";
16import { contact } from "../lib/constants";
15
17
16export default function Blog({ posts, search }) {
18export default function Blog({ posts, search }) {
@@ -48,7 +50,7 @@ export default function Blog({ posts, search }) {
48 <div key={post.slug} className="mb-20 cursor-pointer">
50 <div key={post.slug} className="mb-20 cursor-pointer">
49 <Link href={`/blog/${post.slug}`}>
51 <Link href={`/blog/${post.slug}`}>
50 <div class="flex items-center md:flex-row flex-col">
52 <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">
52 {
54 {
53 // Not all blog posts have images
55 // Not all blog posts have images
54 post.extra.image ? (
56 post.extra.image ? (
pages/blog/[slug].js+7−10
@@ -1,13 +1,4 @@
1import { useRouter } from "next/router";
1import { 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";
11import Head from "next/head";
2import Head from "next/head";
12import Link from "next/link";
3import Link from "next/link";
13import Meta from "../../components/Meta";
4import Meta from "../../components/Meta";
@@ -18,11 +9,17 @@ import {
18 IntraNav,
9 IntraNav,
19 SingleColumn,
10 SingleColumn,
20 Section,
11 Section,
12+ TwoUp,
13+ getPostBySlug,
14+ getAllPosts,
15+ getNextPost,
16+ getPreviousPost,
17+ formatDate,
18+ generateDisplayDate,
21} from "@urbit/foundation-design-system";
19} from "@urbit/foundation-design-system";
22import Header from "../../components/Header";
20import Header from "../../components/Header";
23import Footer from "../../components/Footer";
21import Footer from "../../components/Footer";
24import PostPreview from "../../components/PostPreview";
22import PostPreview from "../../components/PostPreview";
25−import TwoUp from "../../components/TwoUp";
26
23
27export default function Post({
24export default function Post({
28 post,
25 post,
pages/community/[[...slug]].js+1−2
@@ -3,9 +3,8 @@ import Link from "next/link";
3import { useRouter } from "next/router";
3import { useRouter } from "next/router";
4import classnames from "classnames";
4import classnames from "classnames";
5import { join } from "path";
5import { join } from "path";
6−import { getPage } from "../../lib/lib";
7import Meta from "../../components/Meta";
6import Meta from "../../components/Meta";
8−import { Markdown } from "@urbit/foundation-design-system";
7+import { Markdown, getPage } from "@urbit/foundation-design-system";
9import ContentArea from "../../components/ContentArea";
8import ContentArea from "../../components/ContentArea";
10import Sidebar from "../../components/DocsSidebar";
9import Sidebar from "../../components/DocsSidebar";
11import communityTree from "../../cache/community.json";
10import communityTree from "../../cache/community.json";
pages/decentralized-discord.js+1−1
@@ -7,8 +7,8 @@ import {
7 SingleColumn,
7 SingleColumn,
8 IntraNav,
8 IntraNav,
9 TwoUp,
9 TwoUp,
10+ getPostBySlug,
10} from "@urbit/foundation-design-system";
11} from "@urbit/foundation-design-system";
11−import { getPostBySlug } from "../lib/lib";
12import Meta from "../components/Meta";
12import Meta from "../components/Meta";
13import Header from "../components/Header";
13import Header from "../components/Header";
14import Footer from "../components/Footer";
14import Footer from "../components/Footer";
pages/ecosystem/index.js+3−2
@@ -7,6 +7,9 @@ import {
7 Section,
7 Section,
8 IntraNav,
8 IntraNav,
9 Markdown,
9 Markdown,
10+ getAllPosts,
11+ generateDisplayDate,
12+ formatDate,
10} from "@urbit/foundation-design-system";
13} from "@urbit/foundation-design-system";
11import Header from "../../components/Header";
14import Header from "../../components/Header";
12import Footer from "../../components/Footer";
15import Footer from "../../components/Footer";
@@ -14,11 +17,9 @@ import Sidebar from "../../components/Sidebar";
14import Post from "../../components/ecosystem/Post";
17import Post from "../../components/ecosystem/Post";
15import classnames from "classnames";
18import classnames from "classnames";
16import Link from "next/link";
19import Link from "next/link";
17−import { getAllPosts } from "../../lib/lib";
18import fs from "fs";
20import fs from "fs";
19import path from "path";
21import path from "path";
20import Contact from "../../components/Contact";
22import Contact from "../../components/Contact";
21−import { generateDisplayDate, formatDate } from "../../lib/lib";
22
23
23export default function Ecosystem({
24export default function Ecosystem({
24 search,
25 search,
pages/ecosystem/spotlight/[slug].js+2−1
@@ -8,11 +8,12 @@ import {
8 Section,
8 Section,
9 Markdown,
9 Markdown,
10 IntraNav,
10 IntraNav,
11+ getAllPosts,
12+ getPostBySlug,
11} from "@urbit/foundation-design-system";
13} from "@urbit/foundation-design-system";
12import Header from "../../../components/Header";
14import Header from "../../../components/Header";
13import Footer from "../../../components/Footer";
15import Footer from "../../../components/Footer";
14import Post from "../../../components/ecosystem/Post";
16import Post from "../../../components/ecosystem/Post";
15−import { getAllPosts, getPostBySlug } from "../../../lib/lib";
16import fs from "fs";
17import fs from "fs";
17import path from "path";
18import path from "path";
18
19
pages/events.js+2−1
@@ -9,11 +9,12 @@ import {
9 Section,
9 Section,
10 IntraNav,
10 IntraNav,
11 TwoUp,
11 TwoUp,
12+ generateRealtimeDate,
12} from "@urbit/foundation-design-system";
13} from "@urbit/foundation-design-system";
13import Footer from "../components/Footer";
14import Footer from "../components/Footer";
14import Header from "../components/Header";
15import Header from "../components/Header";
15import EventPreview from "../components/EventPreview";
16import EventPreview from "../components/EventPreview";
16−import { getAllEvents, generateRealtimeDate, pair } from "../lib/lib";
17+import { getAllEvents, pair } from "../lib/lib";
17
18
18import { eventKeys } from "../lib/constants";
19import { eventKeys } from "../lib/constants";
19
20
pages/events/[slug].js+7−11
@@ -1,12 +1,4 @@
1import { DateTime } from "luxon";
1import { DateTime } from "luxon";
2−import {
3− getPostBySlug,
4− getAllPosts,
5− getNextPost,
6− getPreviousPost,
7− generateDisplayDate,
8− generateRealtimeDate,
9−} from "../../lib/lib";
10import Head from "next/head";
2import Head from "next/head";
11import Meta from "../../components/Meta";
3import Meta from "../../components/Meta";
12import {
4import {
@@ -15,13 +7,17 @@ import {
15 SingleColumn,
7 SingleColumn,
16 Section,
8 Section,
17 IntraNav,
9 IntraNav,
10+ TwoUp,
11+ getPostBySlug,
12+ getAllPosts,
13+ getNextPost,
14+ getPreviousPost,
15+ generateDisplayDate,
16+ generateRealtimeDate,
18} from "@urbit/foundation-design-system";
17} from "@urbit/foundation-design-system";
19import Header from "../../components/Header";
18import Header from "../../components/Header";
20import Footer from "../../components/Footer";
19import Footer from "../../components/Footer";
21−import Contact from "../../components/Contact";
22import EventPreview from "../../components/EventPreview";
20import EventPreview from "../../components/EventPreview";
23−import TwoUp from "../../components/TwoUp";
24−
25import {
21import {
26 Person,
22 Person,
27 ReadableList,
23 ReadableList,
pages/getting-started/[[...slug]].js+2−7
@@ -4,8 +4,7 @@ import Link from "next/link";
4import { useRouter } from "next/router";
4import { useRouter } from "next/router";
5import classnames from "classnames";
5import classnames from "classnames";
6import { join } from "path";
6import { 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";
9import ContentArea from "../../components/ContentArea";
8import ContentArea from "../../components/ContentArea";
10import Sidebar from "../../components/DocsSidebar";
9import Sidebar from "../../components/DocsSidebar";
11import GettingStartedTree from "../../cache/getting-started.json";
10import GettingStartedTree from "../../cache/getting-started.json";
@@ -212,9 +211,7 @@ function LaunchCards() {
212 },
211 },
213 {
212 {
214 title: "Considerations",
213 title: "Considerations",
215− content: [
216− "Requires familiarity with the command line",
214+ content: ["Requires familiarity with the command line"],
217− ],
218 },
215 },
219 ],
216 ],
220 svg: (
217 svg: (
@@ -231,8 +228,6 @@ function LaunchCards() {
231 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"
228 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"
232 className="fill-wall-600"
229 className="fill-wall-600"
233 />
230 />
234−
235−
236 </svg>
231 </svg>
237 ),
232 ),
238 href: "/getting-started/cli",
233 href: "/getting-started/cli",
pages/grants.js+2−1
@@ -7,13 +7,14 @@ import {
7 SingleColumn,
7 SingleColumn,
8 Section,
8 Section,
9 IntraNav,
9 IntraNav,
10+ getAllPosts,
10} from "@urbit/foundation-design-system";
11} from "@urbit/foundation-design-system";
11import Footer from "../components/Footer";
12import Footer from "../components/Footer";
12import Header from "../components/Header";
13import Header from "../components/Header";
13import GrantPreview from "../components/GrantPreview";
14import GrantPreview from "../components/GrantPreview";
14import JoinGroup from "../components/JoinGroup";
15import JoinGroup from "../components/JoinGroup";
15import omit from "lodash.omit";
16import omit from "lodash.omit";
16−import { getAllPosts, getGrantsCategories, getGrantsTypes } from "../lib/lib";
17+import { getGrantsCategories, getGrantsTypes } from "../lib/lib";
17
18
18function isArray(arr) {
19function isArray(arr) {
19 return Array.isArray(arr);
20 return Array.isArray(arr);
pages/grants/[slug].js+3−1
@@ -1,5 +1,4 @@
1import { useRouter } from "next/router";
1import { useRouter } from "next/router";
2−import { getPostBySlug, getAllPosts, formatDate } from "../../lib/lib";
3import Head from "next/head";
2import Head from "next/head";
4import Link from "next/link";
3import Link from "next/link";
5import Meta from "../../components/Meta";
4import Meta from "../../components/Meta";
@@ -11,6 +10,9 @@ import {
11 SingleColumn,
10 SingleColumn,
12 Section,
11 Section,
13 IntraNav,
12 IntraNav,
13+ getPostBySlug,
14+ getAllPosts,
15+ formatDate,
14} from "@urbit/foundation-design-system";
16} from "@urbit/foundation-design-system";
15import Header from "../../components/Header";
17import Header from "../../components/Header";
16import Footer from "../../components/Footer";
18import Footer from "../../components/Footer";
pages/grants/apprenticeships.js+1−2
@@ -1,6 +1,5 @@
1−import { getPostBySlug } from "../../lib/lib";
2import GrantProgramOverview from "../../components/GrantProgramOverview";
1import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
4
3
5export default function Post({ post, markdown, search }) {
4export default function Post({ post, markdown, search }) {
6 return (
5 return (
pages/grants/bounties.js+1−2
@@ -1,6 +1,5 @@
1−import { getPostBySlug } from "../../lib/lib";
2import GrantProgramOverview from "../../components/GrantProgramOverview";
1import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
4
3
5export default function Post({ post, markdown, search }) {
4export default function Post({ post, markdown, search }) {
6 return (
5 return (
pages/grants/proposals.js+1−2
@@ -1,6 +1,5 @@
1−import { getPostBySlug } from "../../lib/lib";
2import GrantProgramOverview from "../../components/GrantProgramOverview";
1import GrantProgramOverview from "../../components/GrantProgramOverview";
3−import { Markdown } from "@urbit/foundation-design-system";
2+import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
4
3
5export default function Post({ post, markdown, search }) {
4export default function Post({ post, markdown, search }) {
6 return (
5 return (
pages/groups/[[...group]].js+1−1
@@ -1,6 +1,5 @@
1import Head from "next/head";
1import Head from "next/head";
2import Link from "next/link";
2import Link from "next/link";
3−import { getPage } from "../../lib/lib";
4import { join } from "path";
3import { join } from "path";
5import CopyLink from "../../components/CopyLink";
4import CopyLink from "../../components/CopyLink";
6import {
5import {
@@ -8,6 +7,7 @@ import {
8 SingleColumn,
7 SingleColumn,
9 Section,
8 Section,
10 Markdown,
9 Markdown,
10+ getPage,
11} from "@urbit/foundation-design-system";
11} from "@urbit/foundation-design-system";
12import ob from "urbit-ob";
12import ob from "urbit-ob";
13import Header from "../../components/Header";
13import Header from "../../components/Header";
pages/ids/[id].js+2−1
@@ -1,12 +1,13 @@
1import Head from "next/head";
1import Head from "next/head";
2import Link from "next/link";
2import Link from "next/link";
3−import { getPage, getAllPosts } from "../../lib/lib";
4import { join } from "path";
3import { join } from "path";
5import {
4import {
6 Container,
5 Container,
7 SingleColumn,
6 SingleColumn,
8 Section,
7 Section,
9 Markdown,
8 Markdown,
9+ getPage,
10+ getAllPosts,
10} from "@urbit/foundation-design-system";
11} from "@urbit/foundation-design-system";
11import ob from "urbit-ob";
12import ob from "urbit-ob";
12import ResourceCard from "../../components/gateway/ResourceCard";
13import ResourceCard from "../../components/gateway/ResourceCard";
pages/index.js+4−2
@@ -6,15 +6,17 @@ import {
6 Container,
6 Container,
7 Section,
7 Section,
8 SingleColumn,
8 SingleColumn,
9+ TwoUp,
9 IntraNav,
10 IntraNav,
11+ getAllPosts,
12+ generateRealtimeDate,
10} from "@urbit/foundation-design-system";
13} from "@urbit/foundation-design-system";
14+import { getAllEvents } from "../lib/lib";
11import Header from "../components/Header";
15import Header from "../components/Header";
12import Footer from "../components/Footer";
16import Footer from "../components/Footer";
13import Contact from "../components/Contact";
17import Contact from "../components/Contact";
14import PostPreview from "../components/PostPreview";
18import PostPreview from "../components/PostPreview";
15import EventPreview from "../components/EventPreview";
19import EventPreview from "../components/EventPreview";
16−import TwoUp from "../components/TwoUp";
17−import { getAllPosts, getAllEvents, generateRealtimeDate } from "../lib/lib";
18import { eventKeys } from "../lib/constants";
20import { eventKeys } from "../lib/constants";
19import IndexCard from "../components/ecosystem/IndexCard";
21import IndexCard from "../components/ecosystem/IndexCard";
20import fs from "fs";
22import fs from "fs";
pages/marketplaces/[slug].js+6−2
@@ -1,6 +1,10 @@
1−import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
2import BasicPage from "../../components/ecosystem/BasicPage";
1import BasicPage from "../../components/ecosystem/BasicPage";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
3−import { Markdown } from "@urbit/foundation-design-system";
7+} from "@urbit/foundation-design-system";
4import Link from "next/link";
8import Link from "next/link";
5
9
6export default function Marketplace({
10export default function Marketplace({
pages/organizations/[slug].js+6−2
@@ -1,6 +1,10 @@
1−import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
2import BasicPage from "../../components/ecosystem/BasicPage";
1import BasicPage from "../../components/ecosystem/BasicPage";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
3−import { Markdown } from "@urbit/foundation-design-system";
7+} from "@urbit/foundation-design-system";
4import Link from "next/link";
8import Link from "next/link";
5import fs from "fs";
9import fs from "fs";
6import path from "path";
10import path from "path";
pages/overview/[[...slug]].js+3−1
@@ -8,9 +8,11 @@ import {
8 Section,
8 Section,
9 Markdown,
9 Markdown,
10 IntraNav,
10 IntraNav,
11+ getPage,
12+ getPreviousPost,
13+ getNextPost,
11} from "@urbit/foundation-design-system";
14} from "@urbit/foundation-design-system";
12import { join } from "path";
15import { join } from "path";
13−import { getPage, getPreviousPost, getNextPost } from "../../lib/lib";
14import Header from "../../components/Header";
16import Header from "../../components/Header";
15import Footer from "../../components/Footer";
17import Footer from "../../components/Footer";
16import Sidebar from "../../components/Sidebar";
18import Sidebar from "../../components/Sidebar";
pages/podcasts/[slug].js+6−2
@@ -1,6 +1,10 @@
1−import { getAllPosts, getPostBySlug, getPostSlugs } from "../../lib/lib";
2import BasicPage from "../../components/ecosystem/BasicPage";
1import BasicPage from "../../components/ecosystem/BasicPage";
2+import {
3+ Markdown,
4+ getAllPosts,
5+ getPostBySlug,
6+ getPostSlugs,
3−import { Markdown } from "@urbit/foundation-design-system";
7+} from "@urbit/foundation-design-system";
4import Link from "next/link";
8import Link from "next/link";
5
9
6export default function Podcast({
10export default function Podcast({
pages/updates.js+3−1
@@ -6,10 +6,12 @@ import {
6 SingleColumn,
6 SingleColumn,
7 Section,
7 Section,
8 IntraNav,
8 IntraNav,
9+ getAllPosts,
10+ formatDate,
11+ generateDisplayDate,
9} from "@urbit/foundation-design-system";
12} from "@urbit/foundation-design-system";
10import Footer from "../components/Footer";
13import Footer from "../components/Footer";
11import Header from "../components/Header";
14import Header from "../components/Header";
12−import { getAllPosts, formatDate, generateDisplayDate } from "../lib/lib";
13
15
14export default function Updates({ posts, search }) {
16export default function Updates({ posts, search }) {
15 const post = {
17 const post = {
pages/updates/[slug].js+6−10
@@ -1,12 +1,4 @@
1import { useRouter } from "next/router";
1import { useRouter } from "next/router";
2−import {
3− getPostBySlug,
4− getAllPosts,
5− getNextPost,
6− getPreviousPost,
7− formatDate,
8− generateDisplayDate,
9−} from "../../lib/lib";
10import Head from "next/head";
2import Head from "next/head";
11import Meta from "../../components/Meta";
3import Meta from "../../components/Meta";
12import ErrorPage from "../404";
4import ErrorPage from "../404";
@@ -16,10 +8,15 @@ import {
16 SingleColumn,
8 SingleColumn,
17 Section,
9 Section,
18 IntraNav,
10 IntraNav,
11+ getPostBySlug,
12+ getAllPosts,
13+ getNextPost,
14+ getPreviousPost,
15+ formatDate,
16+ generateDisplayDate,
19} from "@urbit/foundation-design-system";
17} from "@urbit/foundation-design-system";
20import Header from "../../components/Header";
18import Header from "../../components/Header";
21import Footer from "../../components/Footer";
19import Footer from "../../components/Footer";
22−import Contact from "../../components/Contact";
23
20
24export default function Post({ post, markdown, search }) {
21export default function Post({ post, markdown, search }) {
25 const router = useRouter();
22 const router = useRouter();
@@ -57,7 +54,6 @@ export default function Post({ post, markdown, search }) {
57 <Section narrow className="markdown">
54 <Section narrow className="markdown">
58 <Markdown.render content={JSON.parse(markdown)} />
55 <Markdown.render content={JSON.parse(markdown)} />
59 </Section>
56 </Section>
60− <Section narrow>/></Section>
61 <Section wide className="flex">
57 <Section wide className="flex">
62 {
58 {
63 // {previousPost === null ? (
59 // {previousPost === null ? (