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