fix(ui): display hostname instead of full url (#376)
This commit is contained in:
parent
49a28144fd
commit
468592f59a
|
@ -6,6 +6,7 @@ const prop = defineProps<{
|
|||
}>()
|
||||
const alt = $computed(() => `${prop.card.title} - ${prop.card.title}`)
|
||||
const isSquare = $computed(() => prop.card.width === prop.card.height)
|
||||
const description = $computed(() => prop.card.description ? prop.card.description : new URL(prop.card.url).hostname)
|
||||
|
||||
// TODO: handle card.type: 'photo' | 'video' | 'rich';
|
||||
</script>
|
||||
|
@ -39,11 +40,8 @@ const isSquare = $computed(() => prop.card.width === prop.card.height)
|
|||
{{ card.providerName }}
|
||||
</p>
|
||||
<strong v-if="card.title" line-clamp-1 text-ellipsis>{{ card.title }}</strong>
|
||||
<p v-if="card.description" text-secondary line-clamp-2 text-ellipsis>
|
||||
{{ card.description }}
|
||||
</p>
|
||||
<p v-else text-secondary line-clamp-2 text-ellipsis>
|
||||
{{ card.url }}
|
||||
<p v-if="description" text-secondary line-clamp-2 text-ellipsis>
|
||||
{{ description }}
|
||||
</p>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
|
|
Loading…
Reference in a new issue