mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Hexo: 背景图
This commit is contained in:
@@ -8,7 +8,7 @@ import { useGlobal } from '@/lib/global'
|
||||
* @param {prev,next} param0
|
||||
* @returns
|
||||
*/
|
||||
export default function ArticleRecommend ({ recommendPosts }) {
|
||||
export default function ArticleRecommend ({ recommendPosts, siteInfo }) {
|
||||
if (!CONFIG_HEXO.ARTICLE_RECOMMEND || !recommendPosts || recommendPosts.length === 0) {
|
||||
return <></>
|
||||
}
|
||||
@@ -25,7 +25,7 @@ export default function ArticleRecommend ({ recommendPosts }) {
|
||||
{recommendPosts.map(post => {
|
||||
const headerImage = post?.page_cover
|
||||
? `url("${post.page_cover}")`
|
||||
: `url("/${BLOG.HOME_BANNER_IMAGE}")`
|
||||
: `url("${siteInfo?.pageCover}")`
|
||||
|
||||
return (
|
||||
<Link key={post.id} title={post.title} href={`${BLOG.PATH}/article/${post.slug}`} passHref>
|
||||
|
||||
@@ -2,10 +2,9 @@ import Link from 'next/link'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import formatDate from '@/lib/formatDate'
|
||||
import { useEffect } from 'react'
|
||||
import BLOG from '@/blog.config'
|
||||
|
||||
export default function HeaderArticle ({ post }) {
|
||||
const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("/${BLOG.HOME_BANNER_IMAGE}")`
|
||||
export default function HeaderArticle ({ post, siteInfo }) {
|
||||
const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("${siteInfo?.pageCover}")`
|
||||
const { isDarkMode } = useGlobal()
|
||||
|
||||
const { locale } = useGlobal()
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useRouter } from 'next/router'
|
||||
* @param sliceCount 截取展示的数量 默认6
|
||||
* @constructor
|
||||
*/
|
||||
const LatestPostsGroup = ({ posts }) => {
|
||||
const LatestPostsGroup = ({ posts, siteInfo }) => {
|
||||
if (!posts) {
|
||||
return <></>
|
||||
}
|
||||
@@ -29,7 +29,7 @@ const LatestPostsGroup = ({ posts }) => {
|
||||
const selected = currentPath === `${BLOG.PATH}/article/${post.slug}`
|
||||
const headerImage = post?.page_cover
|
||||
? `url("${post.page_cover}")`
|
||||
: `url("/${BLOG.HOME_BANNER_IMAGE}")`
|
||||
: `url("${siteInfo?.pageCover}")`
|
||||
|
||||
return (
|
||||
<Link
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function SideRight (props) {
|
||||
</Card>
|
||||
)}
|
||||
{CONFIG_HEXO.WIDGET_LATEST_POSTS && latestPosts && latestPosts.length > 0 && <Card>
|
||||
<LatestPostsGroup posts={latestPosts} />
|
||||
<LatestPostsGroup posts={latestPosts} {...props} />
|
||||
</Card>}
|
||||
|
||||
<div className='sticky top-20'>
|
||||
|
||||
Reference in New Issue
Block a user