ADD: icons for RichTextLink

Hard coded RichTextLink icons
This commit is contained in:
webfussel 2025-02-21 19:52:07 +01:00
parent cc8e4eb1bd
commit 9a1b1acfee
4 changed files with 9 additions and 19 deletions

View file

@ -54,25 +54,25 @@ const burgerLabel = computed(() => isBurgerOpen.value ? burgerCloseLabel : burge
const nav = [
{
to: `/`,
label: 'home',
label: 'Home',
icon: 'house',
'aria-label': 'Link dieser Seite: Startseite'
},
{
to: `/services`,
label: 'leistungen',
label: 'Leistungen',
icon: 'list-checks',
aria: 'Link dieser Seite: Leistungen'
},
{
to: `/references`,
label: 'referenzen',
label: 'Referenzen',
icon: 'at',
aria: 'Link dieser Seite: Referenzen'
},
{
to: `/contact`,
label: 'kontakt',
label: 'Kontakt',
icon: 'chats-circle',
aria: 'Link dieser Seite: Kontakt'
},

View file

@ -1,12 +1,14 @@
<template>
<a :href="href" :target="target" class="text inline-flex-row" :class="{ reverse : icon && icon.position === 'end' }">
<Icon v-if="icon" :name="icon.name" mode="svg" />
<a :href="href" :target="target" class="text inline-flex-row">
{{ content }}
<Icon :name="`ph:${linkIcon}-duotone`" mode="svg" />
</a>
</template>
<script setup lang="ts">
import type { RichTextLink } from './Types'
defineProps<RichTextLink>()
const { href } = defineProps<RichTextLink>()
const linkIcon = href.startsWith('http') ? 'globe' : 'arrow-square-in'
</script>

View file

@ -20,10 +20,6 @@ export type RichTextSpan = RichTextBasis & {
export type RichTextLink = RichTextBasis & {
type: 'a'
href: string
icon ?: {
name: string
position : 'start' | 'end'
}
target ?: string
}

View file

@ -141,10 +141,6 @@ const skills : Skill[] = [
target: '_blank',
css: 'text',
href: 'https://www.storyblok.com',
icon: {
name: 'ph:arrow-square-out-duotone',
position: 'end',
},
content: 'Storyblok'
},
{
@ -165,10 +161,6 @@ const skills : Skill[] = [
target: '_blank',
css: 'text',
href: 'https://www.strapi.io',
icon: {
name: 'ph:arrow-square-out-duotone',
position: 'end',
},
content: 'Strapi'
},
{