import Link from 'next/link' import CONFIG_HEXO from '../config_hexo' import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' /** * 关联推荐文章 * @param {prev,next} param0 * @returns */ export default function ArticleRecommend ({ recommendPosts }) { if (!CONFIG_HEXO.ARTICLE_RECOMMEND || !recommendPosts || recommendPosts.length === 0) { return <> } const { locale } = useGlobal() return (
{locale.COMMON.RELATE_POSTS}
{recommendPosts.map(post => { const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("/${BLOG.HOME_BANNER_IMAGE}")` return (
{post.date?.start_date}
{post.title}
) })}
) }