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, siteInfo }) { const { locale } = useGlobal() if ( !CONFIG_HEXO.ARTICLE_RECOMMEND || !recommendPosts || recommendPosts.length === 0 ) { return <> } return (
{locale.COMMON.RELATE_POSTS}
{recommendPosts.map(post => { const headerImage = post?.page_cover ? `url("${post.page_cover}&w=240")` : `url("${siteInfo?.pageCover}&w=240")` return ( (
{post.date?.start_date}
{post.title}
) ) })}
) }