on master help sign in
pages/bitcoin: add bitcoin page
commit3f3d603b4254b669a6be7ef2c07a48c44923c7c9 authorMatilde Park <matilde.park@urbit.org> dateTue 15 Nov 2022, 18:04 (4 years ago) parent8bc7abb
1 file changed+96
pages/bitcoin.js+96
pages/bitcoin.jsnew file+96
@@ -0,0 +1,96 @@
1+import { Container, SingleColumn, Section, IntraNav, TableOfContents, getAllPosts, getPage, TwoUp, Markdown } from "@urbit/foundation-design-system";
2+import Head from "next/head";
3+import Link from "next/link";
4+import Meta from "../components/Meta";
5+import Header from "../components/Header";
6+import PostPreview from "../components/PostPreview"
7+import { join } from 'path';
8+import EventPreview from "../components/EventPreview";
9+import { getAllEvents } from "../lib/lib";
10+
11+import { eventKeys } from "../lib/constants";
12+
13+
14+export default function Bitcoin({ search, posts, data, markdown, events }) {
15+ const post = {
16+ title: "Bitcoin on Urbit: The Sovereign Stack",
17+ description: "Sound digital money and sound computing need each other to achieve a free and prosperous future, and Urbit and Bitcoin's common paradigm of long-termism and self-sovereignty will get us there."
18+ }
19+
20+ return (
21+ <Container>
22+ <Head>
23+ <title>Bitcoin on Urbit: The Sovereign Stack • urbit.org</title>
24+ {Meta(post)}
25+ </Head>
26+ <IntraNav ourSite="https://urbit.org" search={search} />
27+ <SingleColumn>
28+ <Header search={search} />
29+ <Section>
30+ <h1>{post.title}</h1>
31+ </Section>
32+ <Section className="flex space-x-12">
33+ <div className="min-w-0">
34+ <div>
35+ <p>Sound digital money and sound computing need each other to achieve a free and prosperous future, and Urbit and Bitcoin's common paradigm of long-termism and self-sovereignty will get us there. Check out the resources on this page to learn about current Lightning Network development on Urbit and join the Urbitcoiner community.</p>
36+ </div>
37+ <div className="mt-32">
38+ <h2 className="mb-8" id="blog">Blog Posts</h2>
39+ <TwoUp>
40+ <PostPreview post={posts[0]} key={posts[0].slug} />
41+ {posts[1] ? <PostPreview post={posts[1]} key={posts[1].slug} /> : <div />}
42+ </TwoUp>
43+ <Link href="/blog?tag=bitcoin">
44+ <a className="bg-green-400 text-white button-lg w-fit">
45+ View All
46+ </a>
47+ </Link>
48+ </div>
49+ <div className="mt-32">
50+ <h2 className="mb-8" id="events">Events</h2>
51+ <TwoUp>
52+ <EventPreview event={events[0]} className="mb-8" />
53+ {events[1] ? <EventPreview event={events[1]} className="mb-8" /> : <div />}
54+ </TwoUp>
55+ <Link href="/events?tag=bitcoin">
56+ <a className="bg-wall-600 text-white button-lg w-fit">
57+ View All
58+ </a>
59+ </Link>
60+ </div>
61+ <div className="mt-32">
62+ <h2 className="mb-8" id="title">{data.title}</h2>
63+ <div className="markdown">
64+ <Markdown.render content={JSON.parse(markdown)} />
65+ </div>
66+ </div>
67+ </div>
68+ <TableOfContents markdown={false} />
69+ </Section>
70+ </SingleColumn>
71+ </Container>
72+ )
73+}
74+
75+export async function getStaticProps() {
76+ // Latest blog posts
77+ const posts = getAllPosts(
78+ ["title", "slug", "date", "description", "tags", "extra"],
79+ "blog",
80+ "date"
81+ ).filter((e) => e.tags?.includes("bitcoin"));
82+
83+ const events = getAllEvents(eventKeys, "events").filter((e) => e?.tags?.includes("bitcoin"));
84+
85+ const { data, content } = getPage(join(process.cwd(), 'content', 'bitcoin'));
86+
87+ const markdown = JSON.stringify(Markdown.parse({ post: { content } }));
88+ return {
89+ props: {
90+ posts,
91+ data,
92+ markdown,
93+ events
94+ }
95+ }
96+}