import { ReactNode } from 'react'; import { CoreContent } from 'pliny/utils/contentlayer'; import type { Blog, Authors } from 'contentlayer/generated'; import Comments from '@/components/Comments'; import Link from '@/components/Link'; import PageTitle from '@/components/PageTitle'; import SectionContainer from '@/components/SectionContainer'; import Image from '@/components/Image'; import Tag from '@/components/Tag'; import siteMetadata from '@/data/siteMetadata'; import ScrollTopAndComment from '@/components/ScrollTopAndComment'; const editUrl = (path) => `${siteMetadata.siteRepo}/raw/branch/master/data/${path}`; const Copyright = () => ( 知识共享许可协议 ); const postDateTemplate: Intl.DateTimeFormatOptions = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', }; interface LayoutProps { content: CoreContent; authorDetails: CoreContent[]; next?: { path: string; title: string }; prev?: { path: string; title: string }; children: ReactNode; } export default function PostLayout({ content, authorDetails, next, prev, children, }: LayoutProps) { const { filePath, path, slug, date, title, tags } = content; const basePath = path.split('/')[0]; return (
Published on
{title}
Authors
    {authorDetails.map((author) => (
  • {author.avatar && ( avatar )}
    Name
    {author.name}
    Twitter
    {author.twitter && ( {author.twitter.replace( 'https://twitter.com/', '@', )} )}
  • ))}
{children}
{'View source'}
{siteMetadata.comments && (
)}
); }