on master help sign in
Merge branch 'mp/footer-component' of https://github.com/urbit/urbit.org into mp/footer-component
commitb7f7f3dc6fd211b0ced9600fc50ef5fb08b5522b authorGordon <gordon@hey.com> dateWed 29 Jun 2022, 14:05 (4 years ago) parentce165bcdc8c599
5 files changed+130−58
components/Header.js+16−10 components/Search.js+56 content/events/2022-07-22-urbit-outside-alta-plaza.md+22 lib/constants.js+28−48 pages/api/ops-search.js+8
components/Header.js+16−10
@@ -89,41 +89,47 @@ export default function Header(props) {
8989 }
9090 <MenuTray isOpen={isOpen} setTray={setTray} search={props.search}>
9191 <Link href="/" passHref>
92− <a className="type-ui mb-12">Urbit</a>
92+ <a className="font-semibold mb-4">Urbit</a>
9393 </Link>
94+ <Link href="https://urbit.org" passHref>
95+ <a className="font-semibold mt-2">Urbit.org</a>
96+ </Link>
97+ <Link href="https://operators.urbit.org" passHref>
98+ <a className="mt-2">Operators</a>
99+ </Link>
100+ <Link href="https://developers.urbit.org" passHref>
101+ <a className="mt-2 mb-4">Developers</a>
102+ </Link>
103+ <hr className="border-wall-200" />
94104 <ActiveLink
95105 currentPath={currentPath}
96− className="mr-5 mb-4 type-h3"
106+ className="mt-4 mr-5 mb-4"
97107 href="/manual"
98108 >
99109 Manual
100110 </ActiveLink>
101111 <ActiveLink
102112 currentPath={currentPath}
103− className="mr-5 mb-4 type-h3"
113+ className="mr-5 mb-4"
104114 href="/blog"
105115 >
106116 Blog
107117 </ActiveLink>
108118 <ActiveLink
109119 currentPath={currentPath}
110− className="mr-5 mb-4 type-h3"
120+ className="mr-5 mb-4"
111121 href="/events"
112122 >
113123 Events
114124 </ActiveLink>
115125 <ActiveLink
116126 currentPath={currentPath}
117− className="mr-5 mb-4 text-green-400 type-h3"
127+ className="mr-5 mb-4 text-green-400"
118128 href="/getting-started"
119129 >
120130 Get Started
121131 </ActiveLink>
122− <ActiveLink
123− currentPath={currentPath}
124− className="mr-5 mb-4 type-h3"
125− href="/faq"
126− >
132+ <ActiveLink currentPath={currentPath} className="mr-5 mb-4" href="/faq">
127133 FAQ
128134 </ActiveLink>
129135 </MenuTray>
components/Search.js+56
@@ -18,6 +18,7 @@ class Search extends Component {
1818 this.glossarySearch = this.glossarySearch.bind(this);
1919 this.patpSearch = this.patpSearch.bind(this);
2020 this.devSearch = this.devSearch.bind(this);
21+ this.opsSearch = this.opsSearch.bind(this);
2122 }
2223
2324 searchEndpoint(query) {
@@ -32,6 +33,10 @@ class Search extends Component {
3233 return `/api/glossary?q=${encodeURIComponent(query)}`;
3334 }
3435
36+ opsSearch(query) {
37+ return `/api/ops-search?q=${query}`;
38+ }
39+
3540 patpSearch(query) {
3641 return (
3742 (ob.isValidPatp(`~${deSig(query.toLowerCase())}`) &&
@@ -100,11 +105,21 @@ class Search extends Component {
100105 }));
101106 });
102107
108+ const opsResults = await fetch(this.opsSearch(query))
109+ .then((res) => res.json())
110+ .then((res) => {
111+ return res.results.map((item) => ({
112+ type: "OPS_RESULT",
113+ content: item,
114+ }));
115+ });
116+
103117 const list = [
104118 ...glossaryResults,
105119 ...patpResult,
106120 ...results,
107121 ...devResults,
122+ ...opsResults,
108123 ];
109124
110125 this.setState({ results: list });
@@ -311,6 +326,47 @@ class Search extends Component {
311326 </li>
312327 );
313328 }
329+ if (item.type === "OPS_RESULT") {
330+ const opsItem = Object.assign({}, item.content);
331+ opsItem[
332+ "slug"
333+ ] = `https://operators.urbit.org${item.content.slug}`;
334+ return (
335+ <li
336+ className={`cursor-pointer flex text-left w-full ${
337+ selected ? "bg-green-400" : ""
338+ }`}
339+ {...getItemProps({
340+ key: item.content.link + "-" + index,
341+ index,
342+ item: opsItem,
343+ selected,
344+ })}
345+ >
346+ <div className="p-3">
347+ <p
348+ className={`font-medium text-base ${
349+ selected ? "text-white" : "text-wall-600"
350+ }`}
351+ >
352+ <span className="text-wall-400">
353+ {item.content.parent !== "Content"
354+ ? `operators.urbit.org / ${item.content.parent} /`
355+ : "operators.urbit.org /"}{" "}
356+ </span>
357+ {item.content.title}
358+ </p>
359+ <p
360+ className={`text-base font-regular text-small ${
361+ selected ? "text-midWhite" : "text-wall-500"
362+ }`}
363+ >
364+ {item.content.content}
365+ </p>
366+ </div>
367+ </li>
368+ );
369+ }
314370 return null;
315371 })
316372 : null}
content/events/2022-07-22-urbit-outside-alta-plaza.mdnew file+22
@@ -0,0 +1,22 @@
1++++
2+title = "Urbit Outside: Alta Plaza Park"
3+starts = "2022-07-23T13:00:00"
4+ends = "2022-07-23T19:00:00"
5+timezone = "America/Los_Angeles"
6+location = "Alta Plaza Park, San Francisco, CA"
7+image = "https://media.urbit.org/meetups/FWW0KPAVsAAuhYs.jpg"
8+registration_url = "https://www.meetup.com/urbit-sf/events/286763342/"
9+description = "Urbit Outside in San Francisco"
10+dark = true
11+
12+
13++++
14+
15+![Urbit Outside](https://media.urbit.org/meetups/FWW0KPAVsAAuhYs.jpg)
16+
17+Please join us for a park meetup (picnic optional!) at Alta Plaza Park in Pacific Heights, SF, on Saturday, 7/23. We'll meet at 1:00PM and stay as long as people want to chat. Bring a jacket and your choice of food/drink.
18+Interested friends and the Urbit-curious are always welcome!
19+
20+**Time and date:** 13:00, 2022-07-2022
21+
22+**Place:** Alta Plaza Park, San Francisco, CA
lib/constants.js+28−48
@@ -67,76 +67,56 @@ export const updatesKeys = [
6767export const footerData = [
6868 [
6969 {
70− title: "Use Urbit",
70+ title: "~<br/>Urbit",
7171 links: [
7272 {
73− title: "Getting Started",
74− href: "/getting-started",
73+ title: "Home",
74+ href: "/",
7575 },
76− { title: "User's Manual", href: "/using" },
76+ { title: "Get Started", href: "/getting-started" },
7777 {
78− title: "Urbit Client",
79− href: "https://github.com/urbit/port/releases",
78+ title: "Manual",
79+ href: "/using",
8080 },
8181 {
82− title: "Urbit Binaries",
83− href: "https://github.com/urbit/urbit/releases",
82+ title: "FAQ",
83+ href: "/faq",
8484 },
8585 {
86− title: "Hosting Providers",
87− href: "http://localhost:3000/getting-started/planet#hosting-providers",
86+ title: "Events",
87+ href: "/events",
88+ },
89+ {
90+ title: "Blog",
91+ href: "/blog",
92+ },
93+ {
94+ title: "Grants",
95+ href: "/grants",
8896 },
8997 ],
9098 },
9199 {
92− title: "About",
93− links: [
94− { title: "What's Urbit?", href: "/understanding-urbit" },
95− { title: "Urbit ID", href: "/understanding-urbit/urbit-id" },
96− { title: "Urbit OS", href: "/understanding-urbit/urbit-os" },
97− { title: "Security Audits", href: "/audits" },
98− { title: "FAQ", href: "/faq" },
99− { title: "Whitepaper", href: "https://media.urbit.org/whitepaper.pdf" },
100− ],
101− },
102− {
103− title: "News",
104− links: [
105− { title: "Blog", href: "/blog" },
106− { title: "Events", href: "/events" },
107− { title: "Updates", href: "/updates" },
108− ],
109− },
110− {
111− title: "Develop",
100+ title: " ",
112101 links: [
113− { title: "Documentation", href: "https://developers.urbit.org" },
114102 { title: "GitHub", href: "https://github.com/urbit" },
115103 {
116104 title: "Airlock APIs",
117105 href: "https://github.com/urbit/awesome-urbit#http-apis-airlock",
118106 },
119− ],
120− },
121− {
122− title: "Contribute",
123− links: [
124107 {
125− title: "Issue Tracker",
126− href: "https://github.com/urbit/urbit/issues",
108+ title: "Urbit Binaries",
109+ href: "https://github.com/urbit/urbit/releases",
110+ },
111+ {
112+ title: "Urbit Client",
113+ href: "https://github.com/urbit/port/releases",
127114 },
128− { title: "Urbit Grants", href: "/grants" },
129− ],
130− },
131− {
132− title: "Community",
133− links: [
134115 {
135− title: "Dev Mailing List",
136− href: "https://groups.google.com/a/urbit.org/g/dev?pli=1",
116+ title: "Issue Tracker",
117+ href: "https://github.com/urbit/urbit/issues",
137118 },
138− { title: "Governance", href: "https://github.com/urbit/azimuth" },
139− { title: "Twitter", href: "https://twitter.com/urbit" },
119+ { title: "Whitepaper", href: "https://urbit.org/audits" },
140120 ],
141121 },
142122 ],
pages/api/ops-search.jsnew file+8
@@ -0,0 +1,8 @@
1+export default async (req, res) => {
2+ const results = await fetch(
3+ `https://operators.urbit.org/api/search?q=${req.query.q}`
4+ ).then((res) => res.json());
5+ res.statusCode = 200;
6+ res.setHeader("Content-Type", "application/json");
7+ res.end(JSON.stringify(results));
8+};