import { useRouter } from "next/router"; import Head from "next/head"; import Link from "next/link"; import Meta from "../Meta"; import ErrorPage from "../../pages/404"; import classnames from "classnames"; import { Container, SingleColumn, Section, Markdown, IntraNav, } from "@urbit/foundation-design-system"; import Header from "../Header"; import Footer from "../Footer"; import MetadataBlock from "./MetadataBlock"; export default function BasicPage({ section, post, markdown, search, children, }) { const router = useRouter(); if (!router.isFallback && !post?.slug) { return ; } const metaPost = Object.assign({}, post); metaPost.title = `${post.title} - ${section}`; metaPost.description = section === "Podcast" ? `${post.podcast} - ${post.date}` : post.description; section === "Article" ? `${post.publication} - ${post.date}` : post.description; return ( {post.title} • {section} {Meta(metaPost)} {post.title} {section} {/* General purpose metadata bar -- podcast listen button is special-cased URL, flexed at the end of the row */} {post?.podcast && ( )} {post?.publication && ( )} {post?.author && ( )} {post?.date && ( )} {post?.twitter && ( Twitter @{post.twitter} )} {post?.URL && section !== "Podcast" && section !== "Article" && ( Website {post.URL.slice(post.URL.indexOf("://") + 3)} )} {post?.URL && section === "Urbit Marketplace" && ( Accepts {post.payment.join(", ")} )} {post?.URL && section === "Podcast" && ( Listen )} {post?.URL && section === "Article" && ( Read )} {children} ); }
{section}
Twitter
Website
Accepts
{post.payment.join(", ")}