juanatsap b44f9b9a99 refactor: Rename 'extended' → 'long' + add compact sidebar fonts
BREAKING CHANGE: API parameter renamed from 'extended' to 'long'

## Breaking Change: Terminology Standardization

Renamed 'extended' to 'long' across entire codebase for consistency:

**Backend (Go):**
- internal/handlers/cv.go (7 locations)
  - Migration logic to auto-convert 'extended' → 'long' cookies
  - API validation now rejects 'extended', requires 'long'
  - Toggle state logic updated
- internal/handlers/pdf_test.go (17 occurrences)
  - Test function renamed: TestExportPDF_ExtendedWithSkills → TestExportPDF_LongWithSkills
  - All test cases, parameters, and expected filenames updated
- internal/pdf/generator.go (2 comment updates)

**Frontend:**
- PDF-EXPORT-FEATURE.md (3 occurrences)
- doc/3-API.md (parameter documentation)
- doc/7-CUSTOMIZATION.md (examples updated)
- templates/partials/modals/pdf-modal.html (button text, URLs)
- static/js/main.js (migration logic)
- static/hyperscript/toggles._hs (toggle logic)
- tests/mjs/24-pdf-download-params.test.mjs (test expectations)
- tests/mjs/test-preference-migration.test.mjs (NEW)
- tests/mjs/verify-migration.test.mjs (NEW)

**PDFs Renamed:**
- cv-extended-with_skills-jamr-2025-en.pdf → cv-long-with_skills-jamr-2025-en.pdf
- cv-extended-with_skills-jamr-2025-es.pdf → cv-long-with_skills-jamr-2025-es.pdf

**Migration:** Automatic cookie migration from 'extended' → 'long' for seamless UX

## New Feature: Compact Sidebar Fonts

Reduces page count for short CV with skills from 6 → 5 pages:

**Implementation:**
- Location: internal/pdf/generator.go (lines 154-215)
- Cookie detection: `cookies["cv-length"] == "short"`
- Font reduction: 2-6% (0.94-0.98em) - very subtle
- Only activates for: `length=short` + `version=with_skills`
- Long version: Always uses full-size fonts

**Impact:**
- Page count: 6 pages → 5 pages (16.7% reduction)
- Readability: Maintained - fonts remain professional
- Design philosophy: Subtle, natural content flow

**Testing:**
- New test: TestPDFGenerator_CompactSidebarFonts
- Comprehensive coverage of cookie detection and PDF generation
- Manual verification: 5-page PDF with compact but readable fonts

**Documentation:**
- doc/LONG-PDF-GENERATION.md (NEW, 13 KB)
  - Complete feature documentation
  - Implementation details with code examples
  - Font size breakdown table
  - Testing and troubleshooting guides
  - Compact sidebar fonts section (comprehensive)

**Files Changed:**
- 11 modified (backend + frontend + docs)
- 5 new files (2 PDFs, 1 doc, 2 tests)
- 2 files renamed (PDFs)

**Tests:** All Go tests passing, API validation verified, PDF generation tested
2025-11-20 11:21:43 +00:00
2025-11-10 16:05:36 +00:00
2025-11-12 18:14:48 +00:00
2025-11-14 21:38:09 +00:00
2025-11-14 21:38:09 +00:00
2025-11-16 10:11:58 +00:00

CV Site - Go + HTMX

Go Version HTMX License

Modern, minimal curriculum vitae website for Juan Andrés Moreno Rubio built with Go and HTMX.

A professional, bilingual CV site with server-side PDF generation, HTMX interactivity, and a clean paper design aesthetic. Built as a personal portfolio project showcasing production-grade Go and HTMX development.

📌 Project Status

This is a personal portfolio project demonstrating production-grade Go and HTMX development.

Open Source: The code is MIT licensed and available for educational purposes. You're welcome to use it as a template or reference for your own projects. This repository is maintained as my personal CV site and may be modified without notice.

Contributions: This is a personal CV project and is feature-complete. I'm not seeking contributions, but you're welcome to use it as a template! If you find a critical security vulnerability, please follow the SECURITY.md process.

📑 Table of Contents

🚀 Features

  • Bilingual Support - Spanish and English with instant switching (no page reload)
  • Server-Side PDF Export - Professional PDF generation using chromedp (headless Chrome)
  • Browser Print - Alternative print-friendly layout for manual PDF creation
  • HTMX Dynamic Updates - Smooth UX without heavy JavaScript
  • Paper Design - Professional CV on elegant white paper with gray background
  • Zoom Control - Adjustable zoom (25%-300%) with persistence across sessions
  • Responsive - Mobile, tablet, and desktop friendly
  • JSON-Based Content - Easy to update without touching code
  • AI Development Section - Showcases modern AI-assisted development skills
  • Fast & Lightweight - Go backend with chromedp for PDF generation
  • Privacy-Friendly Analytics - Self-hosted analytics (no third-party data sharing)
  • Security Hardened - CSP headers, XSS protection, origin validation, rate limiting
  • Production Ready - Systemd service, CI/CD workflows, deployment guides
  • Developer Friendly - Hot reload, clear code structure, comprehensive Makefile

📸 Demo

🔗 Live Demo: https://juan.andres.morenorub.io/

Live Features:

  • Single-page application with no page reloads
  • Instant language switching (English ↔ Spanish)
  • Professional PDF export with perfect font rendering
  • Responsive design from mobile to desktop
  • Clean paper aesthetic on gray background
  • Print-friendly layouts

Note: This is my personal CV site. The code is open source for learning and reference purposes.

📋 Running Locally

If you want to explore the code or run it locally:

Prerequisites

  • Go 1.21+ installed
  • Chrome/Chromium (for PDF generation)
  • Make (optional, for easier development)

Local Development

```bash

Download the code

git clone https://github.com/txemac/cv.git cd cv

Option 1: Using Make (recommended)

make dev

Option 2: Using Go directly

go run main.go

Option 3: Build and run binary

go build -o cv-server && ./cv-server ```

Access the Site

Open http://localhost:1999 in your browser

Language switching is instant via HTMX - no page reload required!

📄 Updating Your CV

Edit JSON files in data/:

  • English: data/cv-en.json
  • Spanish: data/cv-es.json

No code changes needed - just refresh browser!

🖨️ Export to PDF

  1. Click "Download as PDF" button in the action bar
  2. PDF is generated server-side using headless Chrome
  3. File downloads automatically: CV-Juan-Andres-Moreno-Rubio-{lang}.pdf

Advantages:

  • Consistent rendering across all platforms
  • Perfect font rendering
  • No browser compatibility issues
  • Professional quality output

Browser Print (Alternative)

  1. Click "Print Friendly" button
  2. Use browser print dialog (Cmd/Ctrl + P)
  3. Select "Save as PDF"

Endpoints:

  • English PDF: http://localhost:1999/export/pdf?lang=en
  • Spanish PDF: http://localhost:1999/export/pdf?lang=es

🎯 Key Technologies

  • Backend: Go 1.21+ (stdlib net/http, graceful shutdown)
  • PDF Generation: chromedp (headless Chrome automation)
  • Frontend: HTMX 1.9.10 (hypermedia-driven interactions)
  • Styling: Custom CSS with Quicksand font from Google Fonts
  • Data: JSON files for easy content management
  • Deployment: Systemd service, manual binary, GitHub Actions CI/CD

📚 Documentation

This project includes comprehensive documentation organized by purpose:

📖 Getting Started

  • README.md - Project overview, quick start, and features (you are here)
  • DEPLOYMENT.md - Production deployment guides for VPS and cloud platforms
  • CUSTOMIZATION.md - How to customize this CV template for your own use

🔧 Technical Reference

  • ARCHITECTURE.md - System design, patterns, and technical decisions
  • API.md - Complete HTTP API reference and HTMX integration

📋 Policies & Standards

📄 License

🚀 Deployment

This project is production-ready with multiple deployment options. See DEPLOYMENT.md for complete guides.

Systemd Service

```bash

Install as systemd service

make install-service

Update running service

make update-service ```

Manual Deployment

```bash

Build optimized binary

make build

Run in production mode

GO_ENV=production ./cv-server ```

Cloud Platforms

Deployment guides available for:

  • Fly.io - Complete fly.toml configuration
  • Google Cloud Run - Container deployment
  • AWS ECS - Task definitions
  • Railway / Render - Auto-deploy configs

See DEPLOYMENT.md for detailed instructions.

Environment Configuration: Copy .env.example to .env and customize:

  • PORT - Server port (default: 1999)
  • GO_ENV - Environment (development/production)
  • TEMPLATE_HOT_RELOAD - Enable template hot-reload in development

Security: See SECURITY.md for production deployment best practices.

🎨 Customization

Want to use this template for your own CV? See CUSTOMIZATION.md for the complete guide!

Quick Start Customization

  1. Update Content: Edit data/cv-en.json and data/cv-es.json with your information
  2. Customize Styling: Modify static/css/main.css (colors, fonts, layout)
  3. Adjust Templates: Edit files in templates/ directory
  4. Add Sections: Update internal/models/cv.go and JSON files

The CUSTOMIZATION.md guide includes:

  • Complete JSON schema documentation
  • Visual customization (colors, fonts, layout)
  • Template modification examples
  • Adding new languages
  • Advanced customization patterns

🔒 Privacy & Analytics

This site demonstrates self-hosted analytics implementation for privacy-conscious tracking.

Key features:

  • Self-hosted analytics (no third-party data sharing)
  • Privacy-friendly (respects Do Not Track)
  • Fully configurable

See PRIVACY.md for complete privacy policy template.


🤝 Using This Template

This project is open-source and available for you to use!

If you use this as a template, you should:

  1. Review the analytics implementation in templates/index.html
  2. Either configure your own analytics server or remove the tracking code
  3. Update CSP headers in internal/middleware/security.go accordingly
  4. Customize PRIVACY.md with your own privacy policy

See CUSTOMIZATION.md for detailed analytics configuration

Other recommended changes:

  • Update all personal information in data/cv-en.json and data/cv-es.json
  • Replace profile photo in static/images/profile/
  • Update ALLOWED_ORIGINS in .env for API protection
  • Customize colors and branding in static/css/main.css

See CUSTOMIZATION.md for the complete customization guide.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

TL;DR: You can use this template for your own CV site, modify it, and distribute it. Just keep the original copyright notice.

💬 Questions or Issues?

🙏 Acknowledgments

  • HTMX - For making hypermedia-driven applications enjoyable
  • chromedp - For reliable headless Chrome automation
  • Go Community - For excellent standard library and tooling
  • AI Assistance - For accelerating development and documentation

Built with ❤️ using Go, HTMX, and AI assistance

S
Description
💼 Professional CV - 🐹 Go • HTMX • 🌐 Bilingual • 📄 Print-ready
Readme MIT 76 MiB
Languages
JavaScript 45.8%
Go 29%
CSS 14.6%
HTML 8.9%
Shell 1.5%
Other 0.2%