Show domain on first line, chop off "www"

This commit is contained in:
Lim Chee Aun 2022-12-11 00:20:23 +08:00
parent 5c813b69be
commit bcf4fe6e5c

View file

@ -181,7 +181,7 @@ function Card({ card }) {
const hasText = title || providerName || authorName; const hasText = title || providerName || authorName;
if (hasText && image) { if (hasText && image) {
const domain = new URL(url).hostname; const domain = new URL(url).hostname.replace(/^www\./, '');
return ( return (
<a <a
href={url} href={url}
@ -200,6 +200,7 @@ function Card({ card }) {
}} }}
/> />
<div class="meta-container"> <div class="meta-container">
<p class="meta domain">{domain}</p>
<p <p
class="title" class="title"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
@ -207,7 +208,6 @@ function Card({ card }) {
}} }}
/> />
<p class="meta">{providerName || authorName}</p> <p class="meta">{providerName || authorName}</p>
<p class="meta domain">{domain}</p>
</div> </div>
</a> </a>
); );