Skip to content

Commit

Permalink
Merge pull request tangly1024#1409 from tangly1024/fix/heo-search-sum…
Browse files Browse the repository at this point in the history
…mary

heo搜索 显示摘要
  • Loading branch information
tangly1024 committed Aug 3, 2023
2 parents 81938c3 + 3b96f21 commit 0e6359c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 1 addition & 10 deletions themes/heo/components/BlogPostCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,12 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
</div>

{/* 摘要 */}
{(!showPreview || showSummary) && !post.results && (
{(!showPreview || showSummary) && (
<p className="line-clamp-2 replace my-3 2xl:my-1 text-gray-700 dark:text-gray-300 text-sm font-light leading-tight">
{post.summary}
</p>
)}

{/* 搜索结果 */}
{post.results && (
<p className="line-clamp-2 mt-4 text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
{post.results.map((r, index) => (
<span key={index}>{r}</span>
))}
</p>
)}

<div className="md:flex-nowrap flex-wrap md:justify-start inline-block">
<div>
{' '}
Expand Down
4 changes: 3 additions & 1 deletion themes/heo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ const LayoutSearch = props => {
<div id='post-outer-wrapper' className='px-5 md:px-0'>
{!currentSearch
? <SearchNav {...props} />
: <div id="posts-wrapper"> {BLOG.POST_LIST_STYLE === 'page' ? <BlogPostListPage {...props} /> : <BlogPostListScroll {...props} />} </div>}
: <div id="posts-wrapper">
{BLOG.POST_LIST_STYLE === 'page' ? <BlogPostListPage {...props} /> : <BlogPostListScroll {...props} />}
</div>}
</div>
</LayoutBase>
)
Expand Down

0 comments on commit 0e6359c

Please sign in to comment.