feat: conditional u-url class names

This commit is contained in:
Ayo Ayco 2025-04-20 09:13:55 +02:00
parent e97504bc4c
commit 1945d493ad
3 changed files with 37 additions and 17 deletions

View file

@ -22,7 +22,11 @@ const year = new Date().getFullYear()
links.map((linkObj) => (
<li title={linkObj.text}>
<a
class="u-url"
class:list={[
{
'u-url': !linkObj.excludeHCard,
},
]}
rel="me"
href={linkObj.url}
aria-label={linkObj.text}

View file

@ -24,7 +24,15 @@ if (Astro.url.pathname !== '/') {
links
.filter((link) => link.url !== '')
.map((link) => (
<a href={link.url} aria-label={link.text}>
<a
class:list={[
{
'u-url': !link.excludeHCard,
},
]}
href={link.url}
aria-label={link.text}
>
<Icon pack={link.set ?? 'mdi'} name={link.icon} />{' '}
{link.text ?? link.icon}
</a>

View file

@ -3,6 +3,7 @@ export type Link = {
icon: string
set?: string
text?: string
excludeHCard?: boolean
}
export const links: Link[] = [
@ -15,11 +16,13 @@ export const links: Link[] = [
text: 'threads',
icon: 'needle-thread',
set: 'tabler',
excludeHCard: true,
},
{
url: 'https://metapixl.com/i/portfolio/ayo',
icon: 'image',
text: 'photos',
excludeHCard: true,
},
// {
// url: "https://www.npmjs.com/~aayco",
@ -30,6 +33,7 @@ export const links: Link[] = [
url: 'https://soundcloud.com/ayoayco',
icon: 'soundcloud',
text: 'music',
excludeHCard: true,
},
]
@ -59,24 +63,28 @@ export const footerLinks: Link[] = [
/**
* TODO: add all socials to about page
*/
// {
// text: 'LinkedIn',
// url: 'https://www.linkedin.com/in/ayoayco',
// icon: 'linkedin',
// },
// {
// text: 'NPM',
// url: 'https://www.npmjs.com/~aayco',
// icon: 'npm',
// },
// {
// text: 'Instagram',
// url: 'https://instagram.com/ayoayco',
// icon: 'instagram',
// },
{
text: 'LinkedIn',
url: 'https://www.linkedin.com/in/ayoayco',
icon: 'linkedin',
excludeHCard: true,
},
{
text: 'NPM',
url: 'https://www.npmjs.com/~aayco',
icon: 'npm',
excludeHCard: true,
},
{
text: 'Instagram',
url: 'https://instagram.com/ayoayco',
icon: 'instagram',
excludeHCard: true,
},
{
text: 'Bluesky',
url: 'https://bsky.app/profile/ayco.io',
icon: 'bluesky',
excludeHCard: true,
},
]