feat: conditional u-url class names
This commit is contained in:
parent
e97504bc4c
commit
1945d493ad
3 changed files with 37 additions and 17 deletions
|
@ -22,7 +22,11 @@ const year = new Date().getFullYear()
|
||||||
links.map((linkObj) => (
|
links.map((linkObj) => (
|
||||||
<li title={linkObj.text}>
|
<li title={linkObj.text}>
|
||||||
<a
|
<a
|
||||||
class="u-url"
|
class:list={[
|
||||||
|
{
|
||||||
|
'u-url': !linkObj.excludeHCard,
|
||||||
|
},
|
||||||
|
]}
|
||||||
rel="me"
|
rel="me"
|
||||||
href={linkObj.url}
|
href={linkObj.url}
|
||||||
aria-label={linkObj.text}
|
aria-label={linkObj.text}
|
||||||
|
|
|
@ -24,7 +24,15 @@ if (Astro.url.pathname !== '/') {
|
||||||
links
|
links
|
||||||
.filter((link) => link.url !== '')
|
.filter((link) => link.url !== '')
|
||||||
.map((link) => (
|
.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} />{' '}
|
<Icon pack={link.set ?? 'mdi'} name={link.icon} />{' '}
|
||||||
{link.text ?? link.icon}
|
{link.text ?? link.icon}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -3,6 +3,7 @@ export type Link = {
|
||||||
icon: string
|
icon: string
|
||||||
set?: string
|
set?: string
|
||||||
text?: string
|
text?: string
|
||||||
|
excludeHCard?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const links: Link[] = [
|
export const links: Link[] = [
|
||||||
|
@ -15,11 +16,13 @@ export const links: Link[] = [
|
||||||
text: 'threads',
|
text: 'threads',
|
||||||
icon: 'needle-thread',
|
icon: 'needle-thread',
|
||||||
set: 'tabler',
|
set: 'tabler',
|
||||||
|
excludeHCard: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'https://metapixl.com/i/portfolio/ayo',
|
url: 'https://metapixl.com/i/portfolio/ayo',
|
||||||
icon: 'image',
|
icon: 'image',
|
||||||
text: 'photos',
|
text: 'photos',
|
||||||
|
excludeHCard: true,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// url: "https://www.npmjs.com/~aayco",
|
// url: "https://www.npmjs.com/~aayco",
|
||||||
|
@ -30,6 +33,7 @@ export const links: Link[] = [
|
||||||
url: 'https://soundcloud.com/ayoayco',
|
url: 'https://soundcloud.com/ayoayco',
|
||||||
icon: 'soundcloud',
|
icon: 'soundcloud',
|
||||||
text: 'music',
|
text: 'music',
|
||||||
|
excludeHCard: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -59,24 +63,28 @@ export const footerLinks: Link[] = [
|
||||||
/**
|
/**
|
||||||
* TODO: add all socials to about page
|
* TODO: add all socials to about page
|
||||||
*/
|
*/
|
||||||
// {
|
{
|
||||||
// text: 'LinkedIn',
|
text: 'LinkedIn',
|
||||||
// url: 'https://www.linkedin.com/in/ayoayco',
|
url: 'https://www.linkedin.com/in/ayoayco',
|
||||||
// icon: 'linkedin',
|
icon: 'linkedin',
|
||||||
// },
|
excludeHCard: true,
|
||||||
// {
|
},
|
||||||
// text: 'NPM',
|
{
|
||||||
// url: 'https://www.npmjs.com/~aayco',
|
text: 'NPM',
|
||||||
// icon: 'npm',
|
url: 'https://www.npmjs.com/~aayco',
|
||||||
// },
|
icon: 'npm',
|
||||||
// {
|
excludeHCard: true,
|
||||||
// text: 'Instagram',
|
},
|
||||||
// url: 'https://instagram.com/ayoayco',
|
{
|
||||||
// icon: 'instagram',
|
text: 'Instagram',
|
||||||
// },
|
url: 'https://instagram.com/ayoayco',
|
||||||
|
icon: 'instagram',
|
||||||
|
excludeHCard: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'Bluesky',
|
text: 'Bluesky',
|
||||||
url: 'https://bsky.app/profile/ayco.io',
|
url: 'https://bsky.app/profile/ayco.io',
|
||||||
icon: 'bluesky',
|
icon: 'bluesky',
|
||||||
|
excludeHCard: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue