Serve pre-rendered PDF as static file for instant download
All checks were successful
Build and Deploy Erika CV / build-and-deploy (push) Successful in 1m10s

- Render PDF once with WeasyPrint, save to static/Erika_Nielsen_CV.pdf
- Change download button from WeasyPrint route to direct static file link
- Faster download, no server-side rendering on each click
This commit is contained in:
Henrik Jess Nielsen
2026-04-19 19:12:54 +02:00
parent ab589f2960
commit badf8a556b
2 changed files with 3 additions and 1 deletions

BIN
static/Erika_Nielsen_CV.pdf Normal file

Binary file not shown.

View File

@@ -384,6 +384,8 @@
box-shadow: 0 4px 20px rgba(74, 143, 232, 0.5);
transition: background 0.2s, transform 0.1s;
z-index: 999;
text-decoration: none;
display: inline-block;
}
.pdf-btn:hover { background: #2f72d0; transform: scale(1.04); }
@@ -732,7 +734,7 @@
</div>
{% if not pdf_mode %}
<button class="pdf-btn" onclick="window.location='/download'">⬇ Download CV som PDF</button>
<a class="pdf-btn" href="/static/Erika_Nielsen_CV.pdf" download="Erika_Nielsen_CV.pdf">⬇ Download CV som PDF</a>
{% endif %}
</body>