Files
cv-site/internal/models/cv.go
T
juanatsap cd5d5cff02 Add photo, company logos, and short/long CV toggle
Features:
- Profile photo display (right side, inline with header)
- Company logos for all major employers (8 logos downloaded)
- Short/Long CV toggle for condensed/detailed view
- Short descriptions (1-2 lines) for quick overview
- Experience separators with border lines

Photo Implementation:
- Circular photo (120px) on right side of header
- Placeholder SVG if photo not uploaded
- Instructions in ADDING-YOUR-PHOTO.md
- Photo stored in static/images/profile/

Company Logos:
- Olympic Broadcasting Services, AENA, SAP, Gigya
- Accenture, Everis, Indra, Megabanner
- 40px logos displayed inline with experience
- Auto-hide if logo missing
- Mobile: logos hidden for cleaner layout

Short/Long Toggle:
- Toggle buttons in action bar (Corto/Largo)
- Short mode: shows shortDescription only
- Long mode: shows full responsibilities + technologies
- CSS-based show/hide (no page reload)
- Defaults to short view

Layout Updates:
- Header: text left, photo right, inline alignment
- Experience items: separated by border lines
- Responsive: photo centers on mobile
- Print-optimized: smaller photo in PDF

Data Updates:
- Added shortDescription field to Experience struct
- 13 short descriptions for all positions (EN/ES)
- Added companyLogo field with filename mapping
- JSON updated with all new fields

Tech:
- Pure CSS toggle (no HTMX needed)
- Vanilla JavaScript for button states
- Maintains bilingual support (ES/EN)
2025-10-27 22:32:32 +00:00

154 lines
4.3 KiB
Go

package models
import (
"encoding/json"
"fmt"
"os"
)
// CV represents the complete curriculum vitae structure
type CV struct {
Personal Personal `json:"personal"`
Summary string `json:"summary"`
Experience []Experience `json:"experience"`
AIDevelopment AIDevelopment `json:"ai_development"`
Education []Education `json:"education"`
Skills Skills `json:"skills"`
Languages []Language `json:"languages"`
Projects []Project `json:"projects"`
Awards []Award `json:"awards"`
Certifications []Certification `json:"certifications"`
Other Other `json:"other"`
Meta Meta `json:"meta"`
}
type Personal struct {
Name string `json:"name"`
Title string `json:"title"`
Location string `json:"location"`
Email string `json:"email"`
Phone string `json:"phone"`
DateOfBirth string `json:"dateOfBirth"`
PlaceOfBirth string `json:"placeOfBirth"`
Citizenship string `json:"citizenship"`
LinkedIn string `json:"linkedin"`
GitHub string `json:"github"`
Behance string `json:"behance"`
Website string `json:"website"`
Photo string `json:"photo"`
}
type Experience struct {
Position string `json:"position"`
Company string `json:"company"`
CompanyLogo string `json:"companyLogo"`
Location string `json:"location"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Current bool `json:"current"`
ShortDescription string `json:"shortDescription"`
Responsibilities []string `json:"responsibilities"`
Technologies []string `json:"technologies"`
Highlights []string `json:"highlights"`
}
type AIDevelopment struct {
Title string `json:"title"`
Period string `json:"period"`
Description string `json:"description"`
Skills []AISkill `json:"skills"`
Achievements []string `json:"achievements"`
}
type AISkill struct {
Category string `json:"category"`
Proficiency string `json:"proficiency"`
Items []string `json:"items"`
}
type Education struct {
Degree string `json:"degree"`
Institution string `json:"institution"`
Location string `json:"location"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Field string `json:"field"`
}
type Skills struct {
Technical []SkillCategory `json:"technical"`
SoftSkills []string `json:"soft_skills"`
}
type SkillCategory struct {
Category string `json:"category"`
Proficiency int `json:"proficiency"`
Items []string `json:"items"`
}
type Language struct {
Language string `json:"language"`
Proficiency string `json:"proficiency"`
Level int `json:"level"`
}
type Project struct {
Name string `json:"name"`
Role string `json:"role"`
URL string `json:"url"`
Period string `json:"period"`
Description string `json:"description"`
Technologies []string `json:"technologies"`
Highlights []string `json:"highlights"`
}
type Award struct {
Title string `json:"title"`
Issuer string `json:"issuer"`
Date string `json:"date"`
Description string `json:"description"`
}
type Certification struct {
Name string `json:"name"`
Issuer string `json:"issuer"`
Date string `json:"date"`
Description string `json:"description"`
}
type Other struct {
DriverLicense string `json:"driverLicense"`
}
type Meta struct {
Version string `json:"version"`
LastUpdated string `json:"lastUpdated"`
Format string `json:"format"`
Language string `json:"language"`
}
// LoadCV loads CV data from a JSON file for the specified language
func LoadCV(lang string) (*CV, error) {
// Validate language
if lang != "en" && lang != "es" {
return nil, fmt.Errorf("unsupported language: %s", lang)
}
// Determine which JSON file to load
filename := fmt.Sprintf("data/cv-%s.json", lang)
// Read the JSON file
data, err := os.ReadFile(filename)
if err != nil {
return nil, fmt.Errorf("error reading file %s: %w", filename, err)
}
// Parse JSON
var cv CV
if err := json.Unmarshal(data, &cv); err != nil {
return nil, fmt.Errorf("error parsing JSON: %w", err)
}
return &cv, nil
}