mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add aliases
This commit is contained in:
parent
e72029d2de
commit
e955cbd076
2 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ import {
|
|||
ListingDetails
|
||||
} from '~/helpers/listing-page.js'
|
||||
|
||||
import Aliases from '~/src/components/listing/aliases.astro'
|
||||
|
||||
import AllUpdatesSubscribe from '~/components/all-updates-subscribe.vue'
|
||||
|
||||
|
||||
|
|
@ -25,6 +27,8 @@ const details = new ListingDetails( listing )
|
|||
{ details.subtitle }
|
||||
</h2>
|
||||
|
||||
<Aliases listing={ listing } />
|
||||
|
||||
|
||||
|
||||
<AllUpdatesSubscribe
|
||||
|
|
|
|||
14
src/components/listing/aliases.astro
Normal file
14
src/components/listing/aliases.astro
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
const {
|
||||
listing
|
||||
} = Astro.props
|
||||
|
||||
const hasMultipleAliases = Array.isArray( listing.aliases ) && listing.aliases.length > 1
|
||||
|
||||
|
||||
const listFormatter = new Intl.ListFormat('en', { style: 'short', type: 'disjunction' });
|
||||
|
||||
---
|
||||
{ hasMultipleAliases ?
|
||||
<small class="text-xs opacity-75">May also be known as ${ listFormatter.format( listing.aliases, 'or' ) }</small>
|
||||
: '' }
|
||||
Loading…
Add table
Add a link
Reference in a new issue