| name | data-files |
| description | Static data - contact.ts, projects.ts, sidebar-items.ts. Use when displaying contact/projects info or adding navigation items. |
Data Files (app/data/)
Static TypeScript data for contact, projects and navigation.
Files
app/data/contact.ts - owner contact information
app/data/projects.ts - array of projects with translations
app/data/sidebar-items.ts - sidebar navigation items
contact.ts
import { contactInfo } from '~/data/contact'
contactInfo.name
contactInfo.title
contactInfo.location
contactInfo.city
contactInfo.country
contactInfo.countryCode
contactInfo.email
contactInfo.siteUrl
contactInfo.socials.github
contactInfo.socials.linkedin
contactInfo.socials.twitter
Do not hardcode these values in components; always import from this file.
sidebar-items.ts
import { sidebarItems, type SidebarItem } from '~/data/sidebar-items'
interface SidebarItem {
titleKey: string
value: string
icon: string
to: string
openInNewTab?: boolean
}
Current items
| value | to | titleKey |
|---|
home | / | navigation.items.home |
about | /about | navigation.items.about |
projects | /projects | navigation.items.projects |
blog | /blog | navigation.items.blog |
resources | /resources | navigation.items.resources |
Adding a new item
import { mdiNewIcon } from '@mdi/js'
{ titleKey: 'navigation.items.new', value: 'new', icon: mdiNewIcon, to: '/new' }
projects.ts
import { projects } from '~/data/projects'
interface Project {
id: string
title: string
description: { en: string; es: string }
tags: string[]
url?: string
github?: string
image?: string
featured?: boolean
}
To display with the current locale:
const { locale } = useI18n()
const description = project.description[locale.value as 'en' | 'es']
Restrictions
- Do not hardcode email, social network URLs or siteUrl - import from
contact.ts
- Do not modify
sidebar-items.ts without adding the corresponding i18n key in both locales
- The data in
projects.ts is static; do not use useBlog() for projects