@@ -5,77 +5,39 @@ import { useRouter } from "next/router";
5import classnames from "classnames";
5import classnames from "classnames";
6import { join } from "path";
6import { join } from "path";
7import { getPage } from "../../lib/lib";
7import { getPage } from "../../lib/lib";
8+import { decode } from "html-entities";
8import Markdown from "../../components/Markdown";
9import Markdown from "../../components/Markdown";
9import ContentArea from "../../components/ContentArea";
10import ContentArea from "../../components/ContentArea";
10import Sidebar from "../../components/Sidebar";
11import Sidebar from "../../components/Sidebar";
11import GettingStartedTree from "../../cache/getting-started.json";
12import GettingStartedTree from "../../cache/getting-started.json";
13−import { decode } from "html-entities";
15−const breadcrumbs = (posts, paths) => {
17− <Link href="/">Urbit</Link>,
18− <span className="px-1">/</span>,
19− <Link href="/getting-started">Getting Started</Link>,
21− let thisLink = "/getting-started";
22− for (const path of paths) {
23− posts = posts.children[path];
24− thisLink = join(thisLink, path);
26− <span className="px-1">/</span>,
27− <Link href={thisLink}>{posts.title}</Link>
33−const childPages = (thisLink, children, level = 0) => (
34− <ul className="pl-0">
35− {children?.map((child) => (
36− <li>{pageTree(join(thisLink, child.slug), child, level)}</li>
41−const pageTree = (thisLink, tree, level = 0) => {
42− const router = useRouter();
44− const isThisPage = router.asPath === thisLink;
46− const pageItemClasses = classnames({
47− "pl-0 font-semibold text-wall-500 text-base hover:text-green-400":
49− "pl-8 text-wall-600 text-base hover:text-green-400": level === 1,
50− "pl-12 text-wall-600 text-base hover:text-green-400": level === 2,
51− "dot relative": isThisPage,
52− "text-green-400": isThisPage,
55− if (thisLink === "/getting-started/cli") {
61− <Link href={thisLink} passHref>
62− <a className={`${pageItemClasses} cursor-pointer`}>{tree.title}</a>
68export default function UsingLayout({ posts, data, params, search, markdown }) {
14export default function UsingLayout({ posts, data, params, search, markdown }) {
69 const router = useRouter();
15 const router = useRouter();
71 const select = (href) => {
17 const select = (href) => {
72− const isSelected = href === router.asPath;
18+ const isSelected =
19+ `/getting-started${href === "" ? "" : `/${href}`}` === router.asPath;
73 return classnames({
20 return classnames({
74 dot: isSelected,
21 dot: isSelected,
75 "text-green-400": isSelected,
22 "text-green-400": isSelected,
76 "text-wall-500": !isSelected,
23 "text-wall-500": !isSelected,
27+ let menu = [{ title: "Overview", slug: "", weight: 0 }],
30+ posts.pages.map((post) => {
31+ if (post?.tag === "additional") {
32+ additional.push(post);
38+ menu.sort((a, b) => a.weight > b.weight);
39+ additional.sort((a, b) => a.weight > b.weight);
79 const rootClasses = "pl-0 font-semibold text-base hover:text-green-400";
41 const rootClasses = "pl-0 font-semibold text-base hover:text-green-400";
@@ -86,35 +48,33 @@ export default function UsingLayout({ posts, data, params, search, markdown }) {
87 <div className="flex h-screen min-h-screen w-screen sidebar">
49 <div className="flex h-screen min-h-screen w-screen sidebar">
88 <Sidebar search={search}>
50 <Sidebar search={search}>
51+ <p className="uppercase font-bold text-xs text-wall-400">
55+ {menu.map((post) => (
91− <Link href="/getting-started" passHref>
57+ <Link href={post.slug} passHref>
93− className={`relative ${select(
58+ <a className={`relative ${select(post.slug)} ${rootClasses}`}>
94− "/getting-started"
59+ {post.title}
102− {childPages("/getting-started", posts.pages)}
103 <ul className="mt-8">
65 <ul className="mt-8">
104 <p className="uppercase font-bold text-xs text-wall-400">
66 <p className="uppercase font-bold text-xs text-wall-400">
105− Advanced
67+ Additional Guides
69+ {additional.map((post) => (
108− <Link href="/getting-started/cli" passHref>
71+ <Link href={post.slug} passHref>
110− className={`relative ${select(
72+ <a className={`relative ${select(post.slug)} ${rootClasses}`}>
111− "/getting-started/cli"
73+ {post.title}
119 </Sidebar>
79 </Sidebar>
120 <ContentArea
80 <ContentArea
@@ -124,28 +84,52 @@ export default function UsingLayout({ posts, data, params, search, markdown }) {
124 search={search}
84 search={search}
125 section={"Getting Started"}
85 section={"Getting Started"}
126 params={params}
86 params={params}
128 <div className="markdown">
89 <div className="markdown">
130 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
91 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
131 ></article>
92 ></article>
133− {!params.slug && <LaunchCards />}
94+ {!params?.slug && <LaunchCards />}
134 </ContentArea>
95 </ContentArea>
101+const breadcrumbs = (posts, paths) => {
103+ <Link href="/">Urbit</Link>,
104+ <span className="px-1">/</span>,
105+ <Link href="/getting-started">Getting Started</Link>,
107+ let thisLink = "/getting-started";
108+ for (const path of paths) {
109+ posts = posts.children[path];
110+ thisLink = join(thisLink, path);
112+ <span className="px-1">/</span>,
113+ <Link href={thisLink}>{posts.title}</Link>
140function LaunchCards() {
119function LaunchCards() {
141 const info = [
120 const info = [
143− title: "Easy",
122+ title: "Desktop app",
144 subtitle: "Deploy Urbit on your local system",
123 subtitle: "Deploy Urbit on your local system",
145 points: [
124 points: [
146− "Zero cost to you",
125+ {
147− "Set up in minutes using a desktop GUI",
127+ content: ["Free", "Set up in minutes"],
130+ title: "Considerations",
148− "Not a permanent way to use Urbit",
131+ content: ["Not a permanent way to use Urbit"],
@@ -165,16 +149,23 @@ function LaunchCards() {
168− href: "/getting-started/easy",
152+ href: "/getting-started/desktop",
171− title: "Fun",
155+ title: "Server setup",
172 subtitle: "Deploy Urbit on a cloud/VPS provider",
156 subtitle: "Deploy Urbit on a cloud/VPS provider",
173 points: [
157 points: [
174− "Self-host and own your data",
158+ {
175− "Portable identity and accessibility from anywhere",
159+ title: "Benefits",
176− "Requires investment in a planet (one-time) and cloud service (monthly)",
160+ content: ["Complete data ownership", "Accessibility from anywhere"],
163+ title: "Considerations",
165+ "Requires monthly cloud service subscription & (one-time) Urbit ID purchase",
177− "Requires Linux proficiency",
166+ "Requires Linux proficiency",
@@ -192,16 +183,27 @@ function LaunchCards() {
195− href: "/getting-started/fun",
186+ href: "/getting-started/server",
198− title: "Hosted",
189+ title: "Hosted urbit",
199 subtitle: "Deploy Urbit on a managed service",
190 subtitle: "Deploy Urbit on a managed service",
200 points: [
191 points: [
195+ "Accessibility from anywhere",
201− "Streamlined setup for ownership and identity",
196+ "Streamlined setup for ownership and identity",
202− "No technical proficiency required",
197+ "No technical proficiency required",
201+ title: "Considerations",
203+ "Requires monthly subscription",
203− "Need to trust your provider",
204+ "Requires trust in your service provider",
204− "Requires monthly investment",
205+ ],
@@ -235,31 +237,44 @@ function LaunchCards() {
238− href: "/getting-started/hosting",
240+ href: "/getting-started/hosted",
242 <div className="flex flex-col space-y-8 mt-8">
244 <div className="flex flex-col space-y-8 mt-8">
243 {info.map((e) => {
245 {info.map((e) => {
245− <div className="py-8 bg-wall-100 rounded-xl">
247+ <div className="p-8 bg-wall-100 rounded-xl max-w-screen-md flex flex-col">
246 <div className="flex">
248 <div className="flex">
247− <div className="px-8 justify-center flex">{e.svg}</div>
249+ <div className="pl-4 pr-8 justify-center items-center flex">
248 <div className="flex flex-col">
252 <div className="flex flex-col">
249− <h4>{e.title}</h4>
253+ <h4 className="text-2xl">{e.title}</h4>
250 <p className="font-light text-lg">{e.subtitle}</p>
254 <p className="font-light text-lg">{e.subtitle}</p>
251− <ul className="mx-8 mt-2 list-disc text-sm flex flex-col space-y-2">
252− {e.points.map((point) => {
253− return <li>{point}</li>;
256− <Link href={e.href} passHref>
257− <a className="button-lg max-w-fit text-white mt-4 bg-green-400">
257+ <div className="flex mt-8">
258+ {e.points.map((section) => {
260+ <div className="basis-1/2">
261+ <p className="uppercase font-bold text-sm text-black">
264+ <ul className="mx-8 my-4 list-disc text-sm flex flex-col space-y-2">
265+ {section.content.map((point) => (
273+ <Link href={e.href} passHref>
274+ <a className="button-lg max-w-fit text-white mt-4 bg-green-400">
@@ -268,7 +283,7 @@ function LaunchCards() {
270export async function getStaticProps({ params }) {
285export async function getStaticProps({ params }) {
271− const posts = GettingStartedTree;
286+ let posts = GettingStartedTree;
273 const { data, content } = getPage(
288 const { data, content } = getPage(