import BLOG from '@/blog.config' import BlogAround from './BlogAround' import Comment from '@/components/Comment' import RecommendPosts from './RecommendPosts' import ShareBar from '@/components/ShareBar' import TagItem from './TagItem' import formatDate from '@/lib/formatDate' import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useRouter } from 'next/router' import ArticleCopyright from './ArticleCopyright' import WordCount from './WordCount' import NotionPage from '@/components/NotionPage' import CONFIG_NEXT from '../config_next' import NotionIcon from '@/components/NotionIcon' /** * * @param {*} param0 * @returns */ export default function ArticleDetail(props) { const { post, recommendPosts, prev, next, showArticleInfo } = props const url = BLOG.LINK + useRouter().asPath const { locale } = useGlobal() const date = formatDate(post?.date?.start_date || post?.createdTime, locale.LOCALE) return (
{showArticleInfo &&
{/* 头图 */} {CONFIG_NEXT.POST_HEADER_IMAGE_VISIBLE && post?.type && !post?.type !== 'Page' && post?.page_cover && (
{/* eslint-disable-next-line @next/next/no-img-element */} {post.title}
)} {/* title */}
{post.title}
{/* meta */}
{post?.type !== 'Page' && (<>
{date}
| {post.lastEditedTime}
)}
} {/* Notion内容主体 */}
{post && ()}
{/* 文章内嵌广告 */}
{showArticleInfo && <> {/* 分享 */} {/* 版权声明 */} {post.type === 'Post' && } {/* 推荐文章 */} {post.type === 'Post' && }
{/* 分类 */} {post.category && <>
<> {post.category}
} {/* 标签列表 */} {post.type === 'Post' && ( <> {post.tagItems && (
{locale.COMMON.TAGS}:
{post.tagItems.map(tag => ( ))}
)} )}
{post.type === 'Post' && } } {/* 评论互动 */}
) }