Serve the versioned PDF from CV actions
Homelab Main / validate (push) Failing after 1m34s Details
Homelab Main / running-update (push) Has been skipped Details
Homelab Main / debian-ops (push) Has been skipped Details

This commit is contained in:
juvenal.diaz 2026-12-06 10:44:39 -06:00
parent 97fbe5e825
commit 0d682bd9af
2 changed files with 30 additions and 2 deletions

View File

@ -101,8 +101,12 @@ $recruiterKeys = [
<?php echo $text['job_title']; ?>
</p>
<p><a href="mailto:juvenaldiaz522@gmail.com">juvenaldiaz522@gmail.com</a> · <a href="tel:+524492176833">+52 449 217 6833</a></p>
<a href="<?php echo asset_url('Juvenal-Diaz-CV.pdf'); ?>" download><?php echo htmlspecialchars($text['cv_download']); ?></a>
<button type="button" class="cv-print-button" onclick="window.print()"><?php echo htmlspecialchars($text['cv_print']); ?></button>
<a href="<?php echo asset_url('/Juvenal-Diaz-CV.pdf'); ?>"
download="Juvenal-Diaz-CV.pdf"><?php echo htmlspecialchars($text['cv_download']); ?></a>
<a class="cv-print-button"
href="<?php echo asset_url('/Juvenal-Diaz-CV.pdf'); ?>"
target="_blank"
rel="noopener"><?php echo htmlspecialchars($text['cv_print']); ?></a>
</div>
<h2 data-translate data-key="cv_summary_title"

View File

@ -0,0 +1,24 @@
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
WEBSITE = ROOT / "apps" / "website"
class WebsiteCVTests(unittest.TestCase):
def test_versioned_cv_is_a_pdf_asset(self):
pdf = WEBSITE / "Juvenal-Diaz-CV.pdf"
self.assertGreater(pdf.stat().st_size, 1024)
self.assertEqual(pdf.read_bytes()[:5], b"%PDF-")
def test_cv_actions_use_the_pdf_instead_of_printing_the_web_page(self):
page = (WEBSITE / "cv.php").read_text()
self.assertEqual(page.count("asset_url('/Juvenal-Diaz-CV.pdf')"), 2)
self.assertIn('download="Juvenal-Diaz-CV.pdf"', page)
self.assertIn('target="_blank"', page)
self.assertNotIn("window.print()", page)
if __name__ == "__main__":
unittest.main()