import Link from '@/components/Link' import PageTitle from '@/components/PageTitle' import SectionContainer from '@/components/SectionContainer' import { BlogSEO } from '@/components/SEO' import Image from '@/components/Image' import Tag from '@/components/Tag' import siteMetadata from '@/data/siteMetadata' import Comments from '@/components/comments' import ScrollTopAndComment from '@/components/ScrollTopAndComment' const editUrl = (fileName) => `${siteMetadata.siteRepo}/raw/master/data/blog/${fileName}` const discussUrl = (slug) => `https://mobile.twitter.com/search?q=${encodeURIComponent( `${siteMetadata.siteUrl}/blog/${slug}` )}` const postDateTemplate = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' } export default function PostLayout({ frontMatter, authorDetails, next, prev, children }) { const { slug, fileName, date, title, images, tags } = frontMatter return (
Published on
{title}
Authors
    {authorDetails.map((author) => (
  • {author.avatar && ( avatar )}
    Name
    {author.name}
    Twitter
    {author.twitter && ( {author.twitter.replace('https://twitter.com/', '@')} )}
  • ))}
{children}
{'Discuss on Twitter'} {` • `} {'View source'}
) }