Try show non-image cards

This commit is contained in:
Lim Chee Aun 2023-04-18 23:46:59 +08:00
parent fdf30c37cb
commit b164d68b4f
2 changed files with 20 additions and 0 deletions

View file

@ -841,6 +841,10 @@ a:focus-visible .card img {
-webkit-line-clamp: 2;
line-clamp: 2;
}
.card.no-image :is(.title, .meta) {
-webkit-line-clamp: 3;
line-clamp: 3;
}
.card .meta.domain {
opacity: 1;
color: var(--link-color);

View file

@ -1335,6 +1335,22 @@ function Card({ card, instance }) {
dangerouslySetInnerHTML={{ __html: html }}
/>
);
} else if (hasText && !image) {
const domain = new URL(url).hostname.replace(/^www\./, '');
return (
<a
href={cardStatusURL || url}
target={cardStatusURL ? null : '_blank'}
rel="nofollow noopener noreferrer"
class={`card link no-image`}
>
<div class="meta-container">
<p class="meta domain">{domain}</p>
<p class="title">{title}</p>
<p class="meta">{description || providerName || authorName}</p>
</div>
</a>
);
}
}