Merge pull request #926 from tangly1024/fix/next-search

修复next/example搜索结果内容太长
This commit is contained in:
tangly1024
2023-03-27 12:30:59 +08:00
committed by GitHub
3 changed files with 11 additions and 2 deletions

View File

@@ -222,4 +222,13 @@ nav {
/* twikoo 评论区超链接样式 */
.tk-main a {
@apply text-blue-700
}
/* 最多显示4行文字 */
.p-4-lines {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
overflow: hidden;
text-overflow: ellipsis;
}

View File

@@ -42,7 +42,7 @@ export const BlogListPage = props => {
</p>
{/* 搜索结果 */}
{p.results && (
<p className="mt-4 text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
<p className="p-4-lines mt-4 text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
{p.results.map(r => (
<span key={r}>{r}</span>
))}

View File

@@ -75,7 +75,7 @@ const BlogPostCard = ({ post, showSummary }) => {
{/* 搜索结果 */}
{post.results && (
<p className="mt-4 text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
<p className="p-4-lines mt-4 text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
{post.results.map(r => (
<span key={r}>{r}</span>
))}