Skip to content

Commit

Permalink
make files more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeanerd committed Dec 10, 2024
1 parent bd2f18b commit f18804e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
14 changes: 8 additions & 6 deletions components/profile/person.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
:social="social"
/>
</div>
<div v-if="person.files && person.files.cv">
<a :href="`/cv/${props.person?.files?.cv}`">
<CustomTag type="gray" icon="heroicons-document-text-20-solid">
Resume
</CustomTag>
</a>
<div v-if="person.files">
<template v-for="{filename, title} in person.files" :key="filename">
<a :href="`/files/${filename}`">
<CustomTag type="gray" icon="heroicons-document-text-20-solid">
{{ title }}
</CustomTag>
</a>
</template>
</div>
</div>
</template>
Expand Down
File renamed without changes.
8 changes: 5 additions & 3 deletions server/profile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export type Image = string;
// Require en, allow any other language
export type LocalizedString = { en: string } & Partial<Record<Locales, string>>;

export type Files = {
cv? : string
}
export type Files = Array<{
title: LocalizedString,
filename: string,
icon: string,
}>

type Person = {
name: {
Expand Down
4 changes: 3 additions & 1 deletion server/profiles/sebastian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export const sebastian: Profile = {
pronouns: [{ en: 'he', de: 'er' }, { en: 'they' }],
languages: ['en', 'de'],
},
files: { cv: 'sebastian-di-luzio.pdf' },
files: [
{ title: { en: 'Resume', de: 'Lebenslauf' }, filename: 'sebastian-di-luzio.pdf', icon: 'heroicons-document-text-20-solid' },
],
},
highlights: {
title: { en: 'Favored Tech Stack', de: 'Lieblings Tech Stack' },
Expand Down

0 comments on commit f18804e

Please sign in to comment.