on master help sign in
media: add, using eventcard
commit39423001110d2f77fe8a0860dae0ce012574f9a6 authorMatilde Park <matilde@tlon.io> dateTue 13 Jul 2021, 18:17 (5 years ago) parent9572d44
10 files changed+190−15
content/media/_index.md−7 content/media/blueprint-2017-galen-wolfe-pauly-on-the-distributed-web.md−1 content/media/epicenter-episode-205-urbit-a-digital-republic-reinventing-the-internet.md−1 content/media/lambdaconf-2016-curtis-yarvin-urbit-a-clean-slate-functional-operating-stack.md−1 content/media/lambdaconf-2018-ted-blackman-ford-urbits-build-system.md−1 content/media/the-ether-review-46-curtis-yarvin-and-galen-wolfe-pauly-on-urbit.md−1 content/media/what-is-urbit.md−1 pages/events.js+2−2 pages/media.js+47 pages/media/[slug].js+141
content/media/_index.mddeleted−7
@@ -1,7 +0,0 @@
1−+++
2−title = "Media"
3−template = "media/list.html"
4−page_template = "media/post.html"
5−sort_by = "date"
6−in_search_index = true
7−+++
content/media/blueprint-2017-galen-wolfe-pauly-on-the-distributed-web.md−1
@@ -8,6 +8,5 @@ author = "Galen Wolfe-Pauly"
88ship = "~ravmel-ropdyl"
99youtube = "9cXTGW9J9a0"
1010+++
11−{{ youtube(id="9cXTGW9J9a0") }}
1211
1312[Blueprint 2017 Talks: Galen Wolfe-Pauly on the Distributed Web](https://www.youtube.com/watch?v=9cXTGW9J9a0)
content/media/epicenter-episode-205-urbit-a-digital-republic-reinventing-the-internet.md−1
@@ -8,6 +8,5 @@ author = "Galen Wolfe-Pauly"
88ship = "~ravmel-ropdyl"
99youtube = "DFeN-TKZor0"
1010+++
11−{{ youtube(id="DFeN-TKZor0") }}
1211
1312[\#205 Galen Wolfe-Pauly: Urbit - A Digital Republic Reinventing the Internet](https://epicenter.tv/episode/205/)
content/media/lambdaconf-2016-curtis-yarvin-urbit-a-clean-slate-functional-operating-stack.md−1
@@ -8,6 +8,5 @@ author = "Curtis Yarvin"
88ship = "~sorreg-namtyv"
99youtube = "bTisf4oxIFo"
1010+++
11−{{ youtube(id="bTisf4oxIFo") }}
1211
1312[Curtis Yarvin: Urbit- A Clean Slate Functional Operating Stack - λC 2016](https://www.youtube.com/watch?v=bTisf4oxIFo)
content/media/lambdaconf-2018-ted-blackman-ford-urbits-build-system.md−1
@@ -8,6 +8,5 @@ author = "Ted Blackman"
88ship = "~rovnys-ricfer"
99youtube = "5ZAFEylHdiU"
1010+++
11−{{ youtube(id="5ZAFEylHdiU") }}
1211
1312[Ted Blackman Ford - Urbit's Build System - λC 2018](https://www.youtube.com/watch?v=5ZAFEylHdiU)
content/media/the-ether-review-46-curtis-yarvin-and-galen-wolfe-pauly-on-urbit.md−1
@@ -8,6 +8,5 @@ author = "Curtis Yarvin + Galen Wolfe-Pauly"
88ship = "~sorreg-namtyv + ~ravmel-ropdyl"
99soundcloud = "https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/289783332&color=%23000000&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false&show_teaser=false&visual=true"
1010+++
11−{{ soundcloud(url="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/289783332&color=%23000000&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false&show_teaser=false&visual=true") }}
1211
1312[The Ether Review \#46 - Curtis Yarvin & Galen Wolfe-Pauly on Urbit](https://soundcloud.com/arthurfalls/the-ether-review-46-smoking-dmt-with-mencius-moldbug)
content/media/what-is-urbit.md−1
@@ -5,6 +5,5 @@ description = "A quick video explainer of how Urbit works."
55[extra]
66youtube = "M04AKTCDavc"
77+++
8−{{ youtube(id="M04AKTCDavc") }}
98
109[What is Urbit?](https://www.youtube.com/watch?v=M04AKTCDavc)
pages/events.js+2−2
@@ -70,14 +70,14 @@ import { getAllPosts, formatDate } from "../lib/lib";
7070// );
7171// }
7272
73−function EventCard({ event }) {
73+export function EventCard({ event, dir }) {
7474 return (
7575 <div
7676 key={event.slug}
7777 className="mb-24 cursor-pointer bg-wall rounded-xl tile-height"
7878 style={{ backgroundImage: event.extra?.image || "" }}
7979 >
80− <Link href={`/events/${event.slug}`}>
80+ <Link href={`${dir ? dir : "/events/"}${event.slug}`}>
8181 <div className="flex flex-col p-8 justify-between items-between h-full relative">
8282 <div className="flex-grow-1 flex flex-col justify-center h-full">
8383 <h3 className="mb-4">{event.title}</h3>
pages/media.jsnew file+47
@@ -0,0 +1,47 @@
1+import Head from "next/head";
2+import Container from "../components/Container";
3+import Footer from "../components/Footer";
4+import Header from "../components/Header";
5+import SingleColumn from "../components/SingleColumn";
6+import { EventCard } from "./events";
7+import Section from "../components/Section";
8+import { getAllPosts } from "../lib/lib";
9+
10+export default function Media({ posts, search }) {
11+ return (
12+ <Container>
13+ <Head>
14+ <title>Urbit • Media</title>
15+ </Head>
16+ <SingleColumn>
17+ <Header search={search} />
18+ <Section narrow>
19+ <div className="measure">
20+ <h1 className="pb-16">Media</h1>
21+ <p className="pb-6">
22+ Selected external media appearances from Tlon and the Urbit
23+ Foundation.
24+ </p>
25+ </div>
26+ </Section>
27+ <Section narrow>
28+ {posts.map((post) => {
29+ return <EventCard event={post} dir="/media/" />;
30+ })}
31+ </Section>
32+ </SingleColumn>
33+ <Footer />
34+ </Container>
35+ );
36+}
37+
38+export async function getStaticProps() {
39+ const posts = getAllPosts(
40+ ["title", "slug", "date", "description", "extra"],
41+ "media"
42+ );
43+
44+ return {
45+ props: { posts },
46+ };
47+}
pages/media/[slug].jsnew file+141
@@ -0,0 +1,141 @@
1+import { useRouter } from "next/router";
2+import {
3+ getPostBySlug,
4+ getAllPosts,
5+ getNextPost,
6+ getPreviousPost,
7+ formatDate,
8+} from "../../lib/lib";
9+import ErrorPage from "../404";
10+import Container from "../../components/Container";
11+import Markdown from "../../components/Markdown";
12+import Header from "../../components/Header";
13+import Footer from "../../components/Footer";
14+import SingleColumn from "../../components/SingleColumn";
15+import NewsletterSignup from "../../components/NewletterSignup";
16+import PostPreview from "../../components/PostPreview";
17+import Section from "../../components/Section";
18+import { contact } from "../../lib/constants";
19+import markdownStyles from "../../styles/markdown.module.css";
20+import { decode } from "html-entities";
21+
22+export default function Medium({ post, markdown, search }) {
23+ const router = useRouter();
24+ if (!router.isFallback && !post?.slug) {
25+ return <ErrorPage />;
26+ }
27+ return (
28+ <Container>
29+ <SingleColumn>
30+ <Header search={search} />
31+ <Section narrow short>
32+ <h1>{post.title}</h1>
33+ {post.extra.author ? (
34+ <div className="type-ui text-gray mt-4 md:mt-8 lg:mt-10">
35+ {post.extra.author}
36+ </div>
37+ ) : null}
38+ {post.extra.ship ? (
39+ <div className="type-ui text-gray font-mono">{post.extra.ship}</div>
40+ ) : null}
41+ <div className="type-ui text-gray mt-16">
42+ {formatDate(new Date(post.date))}
43+ </div>
44+ </Section>
45+ <Section narrow>
46+ {post.extra.youtube ? (
47+ <iframe
48+ className="rounded-xl"
49+ width="100%"
50+ height="640px"
51+ src={`https://www.youtube.com/embed/${post.extra.youtube}`}
52+ frameborder="0"
53+ allow="encrypted-media"
54+ allowfullscreen
55+ ></iframe>
56+ ) : null}
57+ {post.extra.soundcloud ? (
58+ <iframe
59+ width="100%"
60+ height="300"
61+ scrolling="no"
62+ frameborder="no"
63+ allow="autoplay"
64+ src={post.extra.soundcloud}
65+ ></iframe>
66+ ) : null}
67+ </Section>
68+ <Section narrow className={markdownStyles["markdown"]}>
69+ <article
70+ className="pt-12 w-full"
71+ dangerouslySetInnerHTML={{ __html: decode(markdown) }}
72+ ></article>
73+ </Section>
74+ <Section narrow>
75+ <div className="measure">
76+ <h4 className="pb-6">
77+ If you’d like to follow our progress, we send monthly updates via
78+ email:
79+ </h4>
80+ </div>
81+ <NewsletterSignup color="black" />
82+ <h4 className="mt-12 text-gray">
83+ Follow us on{" "}
84+ <a className="text-black" href={contact.twitter}>
85+ Twitter
86+ </a>
87+ </h4>
88+ <h4 className="mt-6 text-gray">
89+ Explore code on{" "}
90+ <a className="text-black" href={contact.github}>
91+ Github
92+ </a>
93+ </h4>
94+ <h4 className="mt-6 text-gray">
95+ Ask questions in our{" "}
96+ <a className="text-black" href={contact.discord}>
97+ Discord
98+ </a>
99+ </h4>
100+ <h4 className="mt-6 text-gray">
101+ Boot Urbit and join{" "}
102+ <code className="bg-wall p-2 rounded-lg">
103+ {contact.urbitCommunity}
104+ </code>
105+ </h4>
106+ </Section>
107+ </SingleColumn>
108+ <Footer />
109+ </Container>
110+ );
111+}
112+
113+//
114+export async function getStaticProps({ params }) {
115+ const post = getPostBySlug(
116+ params.slug,
117+ ["title", "slug", "date", "description", "content", "extra"],
118+ "media"
119+ );
120+
121+ const markdown = await Markdown({ post });
122+
123+ return {
124+ props: { post, markdown, nextPost, previousPost },
125+ };
126+}
127+
128+export async function getStaticPaths() {
129+ const posts = getAllPosts(["slug", "date"], "media");
130+
131+ return {
132+ paths: posts.map((post) => {
133+ return {
134+ params: {
135+ slug: post.slug,
136+ },
137+ };
138+ }),
139+ fallback: false,
140+ };
141+}