diff --git a/themes/hexo/LayoutSearch.js b/themes/hexo/LayoutSearch.js index 6152a282..9f003d2c 100644 --- a/themes/hexo/LayoutSearch.js +++ b/themes/hexo/LayoutSearch.js @@ -13,14 +13,13 @@ export const LayoutSearch = props => { const { locale } = useGlobal() const router = useRouter() const currentSearch = keyword || router?.query?.s - let handleTextColor = false const cRef = useRef(null) useEffect(() => { setTimeout(() => { // 自动聚焦到搜索框 cRef?.current?.focus() - if (currentSearch && !handleTextColor) { + if (currentSearch) { const targets = document.getElementsByClassName('replace') for (const container of targets) { if (container && container.innerHTML) { @@ -29,7 +28,6 @@ export const LayoutSearch = props => { re, `${currentSearch}` ) - handleTextColor = true } } } diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index ab341356..ea95f425 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -78,7 +78,7 @@ const BlogPostCard = ({ post, showSummary }) => { - {CONFIG_HEXO.POST_LIST_COVER && !showPreview && post?.page_cover && ( + {CONFIG_HEXO.POST_LIST_COVER && !showPreview && post?.page_cover && !post.results && (
{/* eslint-disable-next-line @next/next/no-img-element */}