feat: Add year-aware PDF shortcut URLs + Default CV modal option
## Shortcut URLs
- New routes: /cv-jamr-{year}-{lang}.pdf (e.g., /cv-jamr-2025-en.pdf)
- Year validation: Only current year accepted, returns 404 for past/future
- Auto-redirects (301) to: /export/pdf?lang={lang}&length=short&icons=show&version=with_skills
- Both languages supported: en and es
## PDF Modal Updates
- Replaced "Current View" option with "Default CV (Recommended)"
- Visual highlighting: purple gradient badge, star emoji ⭐, bold text
- Uses shortcut URL with dynamic year detection
- Clear recommendation for users (5 pages, short with skills)
## Technical Details
- Handler: DefaultCVShortcut() in internal/handlers/cv.go
- Pattern check in Home() handler for proper routing
- Helper function: window.openPdfModal() for references section
- Documentation: PDF-SHORTCUT-IMPLEMENTATION.md
Benefits:
- Memorable, shareable URLs (juan.andres.morenorub.io/cv-jamr-2025-en.pdf)
- Auto-updates yearly without code changes
- Clear user guidance for recommended CV format
This commit is contained in:
@@ -541,6 +541,21 @@
|
||||
// - Focus trapping (automatic accessibility feature)
|
||||
// No JavaScript needed! All modal logic is now in HTML/CSS.
|
||||
|
||||
// =============================================================================
|
||||
// PDF MODAL HELPER FUNCTION
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Opens the PDF download modal
|
||||
* Called from references section links with action="downloadPDF"
|
||||
*/
|
||||
window.openPdfModal = function() {
|
||||
const pdfModal = document.querySelector('#pdf-modal');
|
||||
if (pdfModal) {
|
||||
pdfModal.showModal();
|
||||
}
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
// TOTAL REDUCTION SUMMARY
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user