diff --git a/site/components/MDX.js b/site/components/MDX.js index 5096e26..a6ec2d0 100644 --- a/site/components/MDX.js +++ b/site/components/MDX.js @@ -1,4 +1,5 @@ import Head from 'next/head' +import ReactPlayer from 'react-player/lazy' import { Paragraph } from './Link' const components = { @@ -8,20 +9,67 @@ const components = { export default function MdxPage({ children }) { const { Component, frontmatter } = children + + let podcastEmbed + + if (frontmatter.podcast && frontmatter.podcast.includes("life-itself")) { + const url = frontmatter.podcast + podcastEmbed = ([ + url.slice(0, "https://anchor.fm/life-itself".length), + "/embed", + url.slice("https://anchor.fm/life-itself".length) + ].join("")) + } return (
-

{frontmatter.title}

+ {frontmatter.title &&

{frontmatter.title}

} {frontmatter.authors && ( -

{frontmatter.authors}

+
+

{frontmatter.authors}

+
)} {frontmatter.date && ( -

{frontmatter.date}

+

+ on {frontmatter.date} +

)} {frontmatter.description && ( -

frontmatter.description}

+

{frontmatter.description}

+ )} + {frontmatter.youtube && ( +
+ +
+ )} + {frontmatter.podcast && ( +
+ + {podcastEmbed && ( +
+