share social links

This commit is contained in:
Yisroel Baum 2026-06-14 22:12:49 +03:00
parent 7b8d09a312
commit 143fae9b93
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 36 additions and 35 deletions

View file

@ -1,34 +1,29 @@
<script setup lang="ts"> <script setup lang="ts">
import { RouterLink } from 'vue-router' import { RouterLink } from 'vue-router'
import { socialLinks, type SocialLinkLabel } from '@/content/socialLinks'
interface FooterLink { interface FooterLink {
label: string label: string
to: string to: string
} }
interface SocialLink {
label: string
href: string
glyph: string
}
const signatureImage = { const signatureImage = {
src: '/assets/signature.png', src: '/assets/signature.png',
alt: "R' Yehoshua Gerzi", alt: "R' Yehoshua Gerzi",
} }
const socialLinks: SocialLink[] = [ const socialGlyphs: Record<SocialLinkLabel, string> = {
{ YouTube: '▶',
label: 'YouTube', Spotify: '♫',
href: '#', }
glyph: '▶',
}, const footerSocialLinks = socialLinks.map((socialLink) => {
{ return {
label: 'Spotify', label: socialLink.label,
href: '#', href: socialLink.href,
glyph: '♫', glyph: socialGlyphs[socialLink.label],
}, }
] })
const footerLinkColumns: FooterLink[][] = [ const footerLinkColumns: FooterLink[][] = [
[ [
@ -49,11 +44,13 @@ const footerLinkColumns: FooterLink[][] = [
<img v-bind="signatureImage" class="site-footer__signature" /> <img v-bind="signatureImage" class="site-footer__signature" />
<div class="site-footer__social"> <div class="site-footer__social">
<a <a
v-for="socialLink in socialLinks" v-for="socialLink in footerSocialLinks"
:key="socialLink.label" :key="socialLink.label"
:href="socialLink.href" :href="socialLink.href"
class="site-footer__social-link" class="site-footer__social-link"
:aria-label="socialLink.label" :aria-label="socialLink.label"
target="_blank"
rel="noopener"
> >
{{ socialLink.glyph }} {{ socialLink.glyph }}
</a> </a>

View file

@ -0,0 +1,19 @@
export type SocialLinkLabel = 'YouTube' | 'Spotify'
export interface SocialLink {
label: SocialLinkLabel
href: string
}
const spotifyShowPath = '49H1X9A7KZWAnnIbcoQXQR?si=6253691f23be44ad'
export const socialLinks: SocialLink[] = [
{
label: 'YouTube',
href: 'https://www.youtube.com/@rabbigerzi',
},
{
label: 'Spotify',
href: 'https://open.spotify.com/show/' + spotifyShowPath,
},
]

View file

@ -2,11 +2,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import SiteHeader from '@/components/SiteHeader.vue' import SiteHeader from '@/components/SiteHeader.vue'
import SiteFooter from '@/components/SiteFooter.vue' import SiteFooter from '@/components/SiteFooter.vue'
import { socialLinks } from '@/content/socialLinks'
interface SocialLink {
label: string
href: string
}
const contactFirstName = ref('') const contactFirstName = ref('')
const contactLastName = ref('') const contactLastName = ref('')
@ -17,17 +13,6 @@ const contactMessage = ref('')
const newsletterFullName = ref('') const newsletterFullName = ref('')
const newsletterEmail = ref('') const newsletterEmail = ref('')
const socialLinks: SocialLink[] = [
{
label: 'YouTube',
href: 'https://www.youtube.com/@rabbigerzi',
},
{
label: 'Spotify',
href: 'https://open.spotify.com/show/49H1X9A7KZWAnnIbcoQXQR?si=6253691f23be44ad',
},
]
function submitContact(submitEvent: Event): void { function submitContact(submitEvent: Event): void {
submitEvent.preventDefault() submitEvent.preventDefault()
contactFirstName.value = '' contactFirstName.value = ''